Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 44 Guests
Online:

LATEST FORUM THREADS

»
Gaming
Q4 General
eXtreme+ v2.9
CoDBO Map + Mod Releases
map loading error
CoD2 MP Mapping
Good Servers on PC
CoDBO General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: giveLife name
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 11:44 am

I am looking for a script

when a player connect to this server

that he sent her as his command

self \ _mod :: giveLife ();
self \ _mod :: giveLife ();

with its pseudo

example

connected his name gives him self lives \ _mod :: giveLife ();
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 12:04 pm
splash93 writes...
Quote:

I am looking for a script

when a player connect to this server

that he sent her as his command

self \ _mod :: giveLife ();
self \ _mod :: giveLife ();

with its pseudo

example

connected his name gives him self lives \ _mod :: giveLife ();


COD4 already has code to give a player a set number of lives. You just get the right dvar for each gametype. Example from TDM (= war in COD4):

set scr_war_numlives 10

That will give a player 10 respawns. After that, they are banished to spectator until the next round/next map.

The player flag for this is in maps\mp\gametypes\_globallogic::SpawnPlayer()

Code:
	if ( self.pers["lives"] )
		self.pers["lives"]--;
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 01:06 pm
I think he mean Death Run's giveLife function, which can be used in this form (via plugins):

Code:

init( modVersion )
{
	while( 1 )
	{
		level waittill( "connected", player );

		if( player.name == "Your name" && !isDefined( player.pers["lifegiven"] ) )
		{
			player.pers["lifegiven"] = true;
			player braxi\_mod::giveLife();
		}
	}
}
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 01:08 pm
I was busy creating a mod.

is to give life to the player that I want

example

player 1 2 life
player 2 2 life

ect ..

edited on Apr. 24, 2012 01:12 pm by splash93


here is my script

main4()
{

{
level waittill( "player_spawn", player );


if( player.pers["admin"] )
{
player braxi\_mod::giveLife();
}
}
}

the problem all round it gives a life
can be done once a map?
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 01:14 pm
splash93 writes...
Quote:
I was busy creating a mod.

is to give life to the player that I want

example

player 1 2 life
player 2 2 life

ect ..

edited on Apr. 24, 2012 01:12 pm by splash93


here is my script

main4()
{

{
level waittill( "player_spawn", player );


if( player.pers["admin"] )
{
player braxi\_mod::giveLife();
}
}
}

the problem all round it gives a life
can be done once a map?


Your answer is 2 posts above.
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Apr. 24, 2012 01:15 pm
BraX writes...
Quote:
I think he mean Death Run's giveLife function, which can be used in this form (via plugins):

Code:

init( modVersion )
{
	while( 1 )
	{
		level waittill( "connected", player );
		//level waittill( "jumper", player ); //can be this if you want to give additional life everytime player spawns

		if( player.name == "Your name" )
		{
			player braxi\_mod::giveLife();
		}
	}
}




a big thank you I will test


possible to add 2 or 3 nickname?

edited on Apr. 24, 2012 01:21 pm by splash93


it works thank you

but it gives life to all rounds can be done once a map?

edited on Apr. 24, 2012 01:23 pm by splash93

solve xd

level waittill( "jumper", player ); //can be this if you want to give additional life everytime player spawns

thxxxxxxxxxxxxxxxxx [wave]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»