Salut sa-mp.ro, am o problema la comanda engine. Cand intru pe server in orice masina as intra o gasesc mereu pornita, daca apasa pe 2 zice ca motorul e pornit, daca mai apas odata zice din nou ca motorul e pornit, nu se poate opriii X_X. Vreau cand intru in orice masina sami zica sa pornesc motorul.
[pawn]if (PRESSED(KEY_LOOK_BEHIND))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
Question
Doggy95
Salut sa-mp.ro, am o problema la comanda engine. Cand intru pe server in orice masina as intra o gasesc mereu pornita, daca apasa pe 2 zice ca motorul e pornit, daca mai apas odata zice din nou ca motorul e pornit, nu se poate opriii X_X. Vreau cand intru in orice masina sami zica sa pornesc motorul.
[pawn]if (PRESSED(KEY_LOOK_BEHIND))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
if(IsPlayerInAnyVehicle(playerid))
{
new veh = GetPlayerVehicleID(playerid);
if(veh != INVALID_VEHICLE_ID)
{
if(EngineStatus[playerid] == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
EngineStatus[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {FF0000}pornit {FFFFFF} motorul!");
format(string, sizeof(string), "* %s a pornit motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(EngineStatus[playerid] == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
EngineStatus[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}oprit {FFFFFF} motorul!");
format(string, sizeof(string), "* %s a oprit motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);[/pawn]
Link to comment
Share on other sites
14 answers to this question
Recommended Posts