Jump to content
  • 0

cum fac sa porneasca pe buton



salut cum fac sa porneasca masina pers cand apesi "2" in loc sa scrii /v engine?

asta e cmd:

[pawn]else if(strcmp(x_nr,"engine",true) == 0)


            if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)


            SendClientMessage(playerid, COLOR_GREY,"This car is not yours.");

            return 1;


        new vehid;

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }

else { return 1; }

if(IsPlayerInVehicle(playerid, vehid))


                SendClientMessage(playerid, COLOR_RED, "You started the car can accelerate.");

SendClientMessage(playerid, COLOR_GREY, "Drive carefully.");

TogglePlayerControllable(playerid, 1);



Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Trebuie sa ai o variabila pentru a retine daca masina este pornita/oprita, pentru a nu enerva jucatorul cand apasa 2, sa nu-i zica mereu ca a pornit masina.

Nu se cer scripturi, foloseste http;//wiki.sa-mp.com/wiki/OnPlayerKeyStateChange , si in el bagi codul de la "engine", cu newkeys & KEY_SUBMISSION.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.