Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: [Akatsuki]Itachi on July 07, 2013, 04:09:26 am
-
These few day, i want to set timer like when you type !heal, need to wait 5 sec, but when i put timer and type 5000 so it must be 5 sec, but it just past away in 1 sec, how to set it so it will be 5 sec ?
-
http://forum.vicecitymultiplayer.com/index.php?topic=5517.0
Seriously....
-
MAKE your own if some error tell us !!!
-
http://forum.vicecitymultiplayer.com/index.php?topic=5517.0
Seriously....
seriously doom??? is very easy repair the mistake and work the command... "but" is more players use the command whit a different of second... not work well. now i turn on my computer for show the solution
-
I dont know what you mean alejandro
-
[pawn]new Heal[MAX_PLAYERS];[/pawn]
[pawn] else if ( strcmp( cmd, "!heal", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
SendClientMessage(playerid,0x333AFFF,"Healing in 5 seconds for prevent death-evade.");
SetTimer( "Healing", 5000,false);
Heal[playerid] = 1;
return 1;
}[/pawn]
[pawn]//==============================================================================
public Healing() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(Heal == 1) {
GameTextForPlayer(i,"Healed");
SetPlayerHealth(i,100);
Heal = 0;
}
}
}
}
//==============================================================================[/pawn]
-
oh boy you're a Genius man...
how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!
-
oh boy you're a Genius man...
I wuz the first to discover passing functions for specific player using variables :P
how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!
lol how does it matter, if the player has to wait 3 secs or 2 secs?
-
oh boy you're a Genius man...
how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!
yeah is right but i put in my command if player have $400 xD not all players have money for heal :D
IF YOU HAVE ANOTHER IDEA OF A COMMAND WHIT TIMER, PLEASE TELL US
-
Yeah here is a perfect idea:
Wait for a good release which can support to pass player id in timer.
lol how does it matter, if the player has to wait 3 secs or 2 secs?
i think 2 secs are enough to evade death.
-
I wuz the first to discover passing functions for specific player using variables :P
No you weren't, there were lots of scripters who done that before you.
oh boy you're a Genius man...
how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!
yeah is right but i put in my command if player have $400 xD not all players have money for heal :D
IF YOU HAVE ANOTHER IDEA OF A COMMAND WHIT TIMER, PLEASE TELL US
You could store the tickcount for the player at heal and then compare with the one in the healing function. If it is over 4000 or 3000, then you can heal him. However I am not sure if pawn can do that.
-
nah I wuz, all rights r reserved