if (strcmp("/v ligar", cmdtext, true, 10) == 0 || strcmp("/v l", cmdtext, true, 10) == 0) { if(IsPlayerInAnyVehicle(playerid)) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(alarme[playerid] == 0) { if(motor[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob); motor[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s girou a chave e ligou o veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } } else { SendClientMessage(playerid, 0xAFAFAFAA, "Vocк nгo pode ligar o carro com o alarme disparado!"); return 1; } } } } if (strcmp("/v desligar", cmdtext, true, 10) == 0 || strcmp("/v d", cmdtext, true, 10) == 0) { if(IsPlayerInAnyVehicle(playerid)) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(motor[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob); motor[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s girou a chave e desligou o veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } } } else { SendClientMessage(playerid, 0xAFAFAFAA, "Vocк nгo estб em um veiculo"); return 1; } }
public OnPlayerExitVehicle(playerid, vehicleid)
motor[playerid] = 1;
pawn Код:
|
if(alarme[playerid] == 0) { alarme[playerid] == 1; } if(alarme[playerid] == 1) { alarme[playerid] == 0; } if(motor[playerid] == 0) { motor[playerid] == 1; } if(motor[playerid] == 1) { motor[playerid] == 0; }