Command help
#1

Please I help with /reapir on time.

if(strcmp(cmdtext, "/repair", true) == 0)
{
RepairVehicle(GetPlayerVehicleID(playerid));
new hrac[150];
GetPlayerName(playerid, hrac, sizeof(hrac));
format(hrac,sizeof(hrac), "**Player %s repair car", hrac); //sprava
SendClientMessageToAll(0xFF0000FF,hrac);

return 1;
}

this command use every five minutes.
Reply
#2

Код:
new canrepair[MAX_PLAYERS];
Under onplayerconnect
Код:
canrepair[playerid] = 1;
Код:
if(strcmp(cmdtext, "/repair", true) == 0)
{
if(canrepair[playerid] == 1){
SetTimerEx("CanRepair", 60000*5, false, "i", playerid);
canrepair[playerid] = 0;
RepairVehicle(GetPlayerVehicleID(playerid));
new hrac[150];
GetPlayerName(playerid, hrac, sizeof(hrac));
format(hrac,sizeof(hrac), "**Player %s repair car", hrac); //sprava
SendClientMessageToAll(0xFF0000FF,hrac);}

return 1;
}
Код:
forward CanRepair(playerid);
public CanRepair(playerid)
{
canrepair[playerid] = 1;
return 1;}
If anything wrong with it say
Reply


Forum Jump:


Users browsing this thread: