01.12.2012, 12:37
Hi Scripterzzz !
I'm editing a Car Ownership Script. I'm making command /vozilo (/vehicle).
Now i want to:
- When player is in any vehicle (except ownable) to show him dialog CMDAvto1
- When player is in ownable vehicle and he is owner (strmatch...) to show him dialog CMDAvto
- When player is in ownable vehicle and he is not owner to show him dialog CMDAvto1
The Code:
With this code when i'm in ownable car (and im owner) gives me dialog CMDAvto1, so i want to give me dialog CMDAvto not CMDAvto1...
EDIT: FIXED
I'm editing a Car Ownership Script. I'm making command /vozilo (/vehicle).
Now i want to:
- When player is in any vehicle (except ownable) to show him dialog CMDAvto1
- When player is in ownable vehicle and he is owner (strmatch...) to show him dialog CMDAvto
- When player is in ownable vehicle and he is not owner to show him dialog CMDAvto1
The Code:
Код:
CMD:vozilo(playerid, params[]) { new ime[MAX_PLAYER_NAME]; GetPlayerName(playerid,ime,sizeof(ime)); new i; new vehicleid = GetPlayerVehicleID(playerid); i = ConvertVehIDtoDYID(vehicleid); new playerState = GetPlayerState(playerid); // Get the killer's state if(!strmatch(MyVehicle[i][MyVehOwner], ime)) { ShowPlayerDialog(playerid, CMDAvto1, DIALOG_STYLE_LIST, "Vozilo Kontrola", "\n-> Pronajdi avtomobil\n-> Pronajdi motor\n-> Pronajdi brod\n-> Pronajdi avion", "OK", "Otkazi"); } else if(strmatch(MyVehicle[i][MyVehOwner], ime)) { ShowPlayerDialog(playerid, CMDAvto, DIALOG_STYLE_LIST, "Vozilo Kontrola", "-> Otkluci/Zakluci avtomobil\n-> Parkiraj\n-> Pronajdi avtomobil\n-> Prodadi avtomobil\n-> Prodadi avtomobil na igrac", "OK", "Otkazi"); } else { if(playerState == PLAYER_STATE_DRIVER) return ShowPlayerDialog(playerid, CMDAvto1, DIALOG_STYLE_LIST, "Vozilo Kontrola", "\n-> Pronajdi avtomobil\n-> Pronajdi motor\n-> Pronajdi brod\n-> Pronajdi avion", "OK", "Otkazi"); } return 1; }
EDIT: FIXED