11.06.2012, 20:24
How comes all my timers do this ?
When ever i hotwire a car it makes everyone wait 10 seconds before they can hotwire a car aging even if they have not done it in hours.. It sends a message to everyone saying you can not hot wire a car again
Please Help
If you need any more code just ask
Thank You
Please Help
When ever i hotwire a car it makes everyone wait 10 seconds before they can hotwire a car aging even if they have not done it in hours.. It sends a message to everyone saying you can not hot wire a car again
Please Help
pawn Код:
command(hotwire, playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
new veh = GetPlayerVehicleID(playerid);
new rand = random(10);
if(IsPlayerInVehicle(playerid, veh))
{
if(AbleToHotWire == 0)
{
if(engine == 0)
{
switch(rand)
{
case 1,2,4,7,9:
{
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, 0);
format(string, sizeof(string), "%s has successfuly hotwired the vehicle", GetNameNoUnderScore(playerid));
AbleToHotWire = 1;
IsPlayerInHotWiredCar = 1;
SetTimer("ResetHotWireTime", 10000, false);
NearByMessage(playerid, PURPLE, string);
}
case 3,5,6,8,10:
{
format(string, sizeof(string), "%s has failed at hotwiring the vehicle", GetNameNoUnderScore(playerid));
NearByMessage(playerid, PURPLE, string);
AbleToHotWire = 1;
SetTimer("ResetHotWireTime", 10000, false);
}
}
}
if(engine == 1)
{
SendClientMessage(playerid, WHITE, "The vehicles engine is on no need to hotwire");
}
}
else
{
SendClientMessage(playerid, WHITE, "You can not hotwire a car yet");
}
}
}
pawn Код:
forward ResetHotWireTime(playerid);
pawn Код:
public ResetHotWireTime(playerid)
{
AbleToHotWire = 0;
SendClientMessage(playerid, WHITE, "You can now hotwire a car again");
}
Thank You
Please Help