22.04.2011, 18:27
Glad to see someone is using my script.
You can use the IsVehicleHot function to tell if he already has used it.
Now with that, he'll be able to use it again once he fires his missiles. If you want him to just be able to equip them once, you'll need a PVar or something else specific to that playerid. For that purpose, try this. You will have to switch the PVar back after the derby for him to be able to use them again.
![Cheesy](images/smilies/biggrin.png)
pawn Код:
CMD:addmissiles(playerid,params[])
{
if(IsPlayerInDerby[playerid] == 1)
{
new Veh = GetPlayerVehicleID(playerid);
if(!IsVehicleHot(Veh))
{
AddVehicleMissiles(Veh,1.1,-0.2);
GetPlayerName(playerid, pName,32);
format(string, sizeof string,"[DERBY] %s added missiles to his/her car !",pName);
SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You already equipped missiles !");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You are not in the derby !");
return 1;
}
return 1;
}
pawn Код:
CMD:addmissiles(playerid,params[])
{
if(IsPlayerInDerby[playerid] == 1)
{
if(!GetPVarInt(playerid,"Missiles"))
{
SetPVarInt(playerid,"Missiles",1);
AddVehicleMissiles(GetPlayerVehicleID(playerid),1.1,-0.2);
GetPlayerName(playerid, pName,32);
format(string, sizeof string,"[DERBY] %s added missiles to his/her car !",pName);
SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You already equipped missiles !");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You are not in the derby !");
return 1;
}
return 1;
}