how to make cmd : 1 cmd per minute
#1

Код:
 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
Reply
#2

pawn Код:
SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...)
or
pawn Код:
GetTickCount()
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)