24.12.2011, 19:25
Here you go.
pawn Код:
new CarHotwired[MAX_VEHICLES]; // add at top of script, you know this.
CMD:hotwire(playerid, params[])
{
new
string[128],
giveplayerid,
vehicleid = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pToolKit] == 1 && PlayerInfo[playerid][pHotWire] == 0)
{
format(string, sizeof(string), "* %s Grabs his/her toolkit and begins to unzip it", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("Hotwire",1000, 0 , "dd", vehicleid, playerid);
SetTimerEx("Hotwire1",3000, 0 , "dd", vehicleid, playerid);
SetTimerEx("Hotwire2",5000, 0 , "dd", vehicleid, playerid);
SetTimerEx("Hotwire3",7000, 0 , "dd", vehicleid, playerid);
SetTimerEx("Hotwire4",9000, 0 , "dd", vehicleid, playerid);
SetTimerEx("SetVehicleEngine",10000, 0, "dd", vehicleid, playerid);
GameTextForPlayer(playerid, "~r~Hotwiring.....", 10000,4);
//CarHotwired[vehicleid] == 1; **ADD THIS WHERE YOU DECIDE IF THE HOTWIRE WAS SUCCESSFUL OR NOT
}
if(PlayerInfo[playerid][pToolKit] == 1 && PlayerInfo[playerid][pHotWire] == 1)
return SendClientMessage(playerid,COLOR_RED,"You are already hotwiring this car.");
if(PlayerInfo[playerid][pToolKit] == 0)
return SendClientMessageEx(playerid, COLOR_GREY, "You need a toolkit to hotwire this car");
if(CarHotwired[vehicleid] == 1)
return SendClientMessage(playerid, COLOR_RED, "Car has already been hotwired.");
return 1;
}