how to make cmd : 1 cmd per minute - 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: how to make cmd : 1 cmd per minute (
/showthread.php?tid=259333)
how to make cmd : 1 cmd per minute -
handerson - 04.06.2011
Код:
if (strcmp("/heal", cmdtext, true, 5) == 0)
{
if(IsPlayerVipType(playerid,1))
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOR_ORANGE,"[VIP Silver]You have been Healed");
return 1;
}
i want to make player can use that command, once per minute
Re: how to make cmd : 1 cmd per minute - Max_Coldheart - 04.06.2011
pawn Код:
SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...)
or
Re: how to make cmd : 1 cmd per minute -
park4bmx - 04.06.2011
pawn Код:
//at the top Put this
new CanUseHeal[MAX_PLAYERS];
//the comamnd
if (strcmp("/heal", cmdtext, true, 5) == 0)
{
if(IsPlayerVipType(playerid,1) && CanUseHeal[playerid]==1)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOR_ORANGE,"[VIP Silver]You have been Healed");
CanUseHeal[playerid]=1;
SetTimer("HealAvailable", 60000, false);
return 1;
}else return SendClientMessage(playerid,COLOR_RED,"You need to wait 1 minute to heal yourself");
//put this in the bottum of ur script
forward HealAvailable();
public HealAvailable()
{
for(new playerid; playerid < MAX_PLAYERS; playerid ++)
{
if(IsPlayerConnected(playerid)) return CanUseHeal[playerid]=0;
}
return 1;
}