if(newkeys == KEY_WALK) { if(IsPlayerInAnyVehicle(playerid)) { if(IsPlayerConnected(playerid)) { new Vehicle = GetPlayerVehicleID(playerid); if(VehicleStarted[Vehicle] == 1) { new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s turns the engine off", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); printf("%s", string); VehicleStarted[Vehicle] = 0; TogglePlayerControllable(playerid,1); RemovePlayerFromVehicle(playerid); }else{ SendClientMessage(playerid,0xAFAFAFAA,"[!] The engine is already off!"); } } } } if(newkeys == KEY_WALK) { if(IsPlayerInAnyVehicle(playerid)) { if(IsPlayerConnected(playerid)) { new Vehicle = GetPlayerVehicleID(playerid); if(VehicleStarted[Vehicle] == 0) { new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s tries to start the vehicle", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); printf("%s", string); GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~ g~Starting vehicle...",3000,3); SetTimerEx("Starting",3500,0,"i",playerid); }else{ SendClientMessage(playerid,COLOR_GRAD2,"[!] This vehicle is already started!"); } } } } return 0; } |
SetTimerEx("Starting",3500,0,"i",playerid); |
if(newkeys == KEY_WALK)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Vehicle = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(VehicleStarted[Vehicle] == 1)
{
format(string, sizeof(string), "* %s turns the engine off", name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
print(string);
VehicleStarted[Vehicle] = 0;
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
else
{
format(string, sizeof(string), "* %s tries to start the vehicle", name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
print(string);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~g~Starting vehicle...",3000,3);
SetTimerEx("Starting",3500,0,"i",playerid); //I hope you have 'VehicleStarted[Vehicle] = 1;' somewhere in this timer.
}
}
}