/fix command with 60 seconds
#1

hey guys
so I want to make a command ...(/fix). that I can use every 60 seconds.so in this command Clearly I will have to use timers for playerid. so I tried to do the next thing :

up on the GM
Код:
new canRep[MAX_PLAYERS];
forward FreeRepair(playerid);
if canRep is 0 then he can repair.if its 1 then he cant.(has to wait 60 secs)

now,OnPlayerConnect
Код:
canRap[playerid] = 0;
then under onplayercommandtext
Код:
	if (strcmp("/fix",cmdtext,true,10) == 0) //ElkaBlazer
	{
	    for(new i = 0;i < MAX_PLAYERS;i++)
		{
		    if(canRep[playerid] == 0)
		    {
		        if(IsPlayerInAnyVehicle(playerid))
				{
				SetVehicleHealth(GetPlayerVehicleID(playerid),100.000);
				SendClientMessage(playerid,COLOR_ADMINS,"You have fixed the vehicle!");
                canRep[playerid] = 1;
                SetTimerEx("FreeRepair",60000,0,"i");
				}
		    }
		}
	    return 1;
	}
and i have the public
Код:
public FreeRepair(playerid)
{
	canRep[playerid] = 0;
}
Reply


Messages In This Thread
/fix command with 60 seconds - by bijoyekuza - 18.03.2011, 15:10
Re: /fix command with 60 seconds - by WackoX - 18.03.2011, 15:21
Re: /fix command with 60 seconds - by bijoyekuza - 18.03.2011, 15:33
Re: /fix command with 60 seconds - by WackoX - 18.03.2011, 20:53
Re: /fix command with 60 seconds - by JaTochNietDan - 18.03.2011, 21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)