08.11.2008, 13:30
hello to everyone, I have created a script but works only for the player with id 0, why?
here's the script:
on top:
new BOOM[MAX_PLAYERS];
ongamemode:
SetTimer("killcar", 1000, 1);
onplayercommandtext:
if (strcmp("/boom", cmdtext, true, 10) == 0)
{
BOOM[playerid] = 1;
SendClientMessage(playerid, GREEN, "Per disattivare il comando /boff");
return 1;
}
if(strcmp(cmdtext,"/boff",true)==0)
{
BOOM[playerid] = 0;
SendClientMessage(id, yellow, "Comando disattivato");
return 1;
}
at the end:
forward killcar(playerid);
public killcar(playerid)
{
if(BOOM[playerid] == 1)
{
SetVehicleHealth(GetPlayerVehicleID(playerid) ,3);
SetTimer("killcar2", 4000, 1);
return 1;
}
}
forward killcar2(playerid);
public killcar2(playerid)
{
SetVehicleHealth(GetPlayerVehicleID(playerid) ,1000);
SetTimer("killcar", 1000, 1);
return 1;
}
sorry for English disgusting but I use the translator of ******, I am Italian XD