Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) (
/showthread.php?tid=152016)
Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
jonas4334 - 02.06.2010
Hi I Want to know how to do /kill and wait 150 sec before do it Agian

'
So please help me/Jonas4334
Re: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
[NYRP]Mike. - 02.06.2010
pawn Код:
new PlayerKilled[MAX_PLAYERS] = 0;
if(strcmp(cmdtext, "/kill", true) == 0)
{
if(PlayerKilled[playerid] == 1)
{
SendClientMessage(playerid, COLOR, "You have to wait 150 seconds before typing this again.");
return 1;
}
SetPlayerHealth(playerid, 0;
PlayerKilled[playerid] = 1;
SetTimerEx("ResetKill",150000, false, "i", playerid);
}
forward ResetKill(playerid);
public ResetKill(playerid)
{
PlayerKilled[playerid] = 0;
return 1;
}
Re: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
[HiC]TheKiller - 02.06.2010
Quote:
Originally Posted by »Shadow™«
pawn Код:
new PlayerKilled[MAX_PLAYERS] = 0;
if(strcmp(cmdtext, "/kill", true) == 0) { if(PlayerKilled[playerid] == 1) { SendClientMessage(playerid, COLOR, "You have to wait 150 seconds before typing this again."); return 1; } SetPlayerHealth(playerid, 0; PlayerKilled[playerid] = 1; SetTimerEx("ResetKill",150000, false, "i", playerid); } forward ResetKill(playerid); public ResetKill(playerid) { PlayerKilled[playerid] = 0; return 1; }
|
Use Pvars, much better for the script.
Re: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
[NYRP]Mike. - 02.06.2010
Quote:
Originally Posted by jonas4334
Hi I Want to know how to do /kill and wait 150 sec before do it Agian  '
So please help me/Jonas4334
|
Yeah, I try to keep it basic for the new people...
Re: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
jonas4334 - 02.06.2010
I Dont know where to put it in pawn lol
Re: Hi I Want to know how to do /kill and wait 150 sec before do it Agian :) -
bartje01 - 02.06.2010
TOP of your script
Код:
new PlayerKilled[MAX_PLAYERS] = 0;
OnPlayerCommandText
Код:
if(strcmp(cmdtext, "/kill", true) == 0)
{
if(PlayerKilled[playerid] == 1)
{
SendClientMessage(playerid, COLOR, "You have to wait 150 seconds before typing this again.");
return 1;
}
SetPlayerHealth(playerid, 0;
PlayerKilled[playerid] = 1;
SetTimerEx("ResetKill",150000, false, "i", playerid);
}
Anywhere.
I prefer have the bottom tough.
Код:
forward ResetKill(playerid);
public ResetKill(playerid)
{
PlayerKilled[playerid] = 0;
return 1;
}