, Float:y, Float:z, Float:a;SetTimerEx("HabilitarComando",20000,false,"i",playerid);//Esto dentro del comando
SetPVarInt(playerid,"NoPuedeComando",1);//Esto tambien
forward HabilitarComando(playerid);//Estos en cualquier otro lado
public HabilitarComando(playerid)
{
DeletePVar(playerid,"NoPuedeComando");
return 1;
}
if(GetPVarInt(playerid,"NoPuedeComando") == 1) return 0;
SetTimerEx("HabilitarComando",20000,false,"i",playerid);//Esto dentro del comando
SetPVarInt(playerid,"NoPuedeComando",1);//Esto tambien
forward HabilitarComando(playerid);//Estos en cualquier otro lado
public HabilitarComando(playerid)
{
DeletePVar(playerid,"NoPuedeComando");
return 1;
}
if(GetPVarInt(playerid,"NoPuedeComando") == 1) return 0;
new TiempoEspera[MAX_PLAYERS];
if (!strcmp("/ccar nr", cmdtext, true))
{
if((gettime() - TiempoEspera[playerid]) < 20) return SendClientMessage(playerid, -1, "Debes esperar 20 segundos");
new VehNrg, Float, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerVehicleID(playerid);
GetPlayerFacingAngle(playerid, a);
SpawnAuto[playerid] = CreateVehicle(522, x, y+2, z+1, a, -1, -1, -1);
SetVehicleVirtualWorld(VehNrg, GetPlayerVirtualWorld(playerid));
GivePlayerMoney(playerid, -500);
SendPlayerFormattedText(playerid," Has comprado un Vehiculo ($-500)", 0);
TiempoEspera = gettime();
return 1;
}
|
mбs simple asi
Код:
new TiempoEspera[MAX_PLAYERS];
if (!strcmp("/ccar nr", cmdtext, true))
{
if((gettime() - TiempoEspera[playerid]) < 20) return SendClientMessage(playerid, -1, "Debes esperar 20 segundos");
new VehNrg, Float, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerVehicleID(playerid);
GetPlayerFacingAngle(playerid, a);
SpawnAuto[playerid] = CreateVehicle(522, x, y+2, z+1, a, -1, -1, -1);
SetVehicleVirtualWorld(VehNrg, GetPlayerVirtualWorld(playerid));
GivePlayerMoney(playerid, -500);
SendPlayerFormattedText(playerid," Has comprado un Vehiculo ($-500)", 0);
TiempoEspera = gettime();
return 1;
}
|
new Seconds = gettime();
printf("Seconds since midnight 1st January 1970: %d", Seconds);