Dialogs... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialogs... (
/showthread.php?tid=396590)
Dialogs... -
NeroX98 - 01.12.2012
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:
Код:
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;
}
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