SA-MP Forums Archive
Can someone help me? - 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: Can someone help me? (/showthread.php?tid=526733)



Can someone help me? - PrinceOfPersia - 19.07.2014

Hello, I'm just wondering.

I want to make the /cchange, which you change your class.

When you type /cchange, it SendClientMessage(playerid, COLOR_YELLOW, "You will change your class upon the next death");


So, I want this command to show the dialog when you die, and you've requested to use it

The CMD
Код:
CMD:cchange(playerid, params[])
{
	ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Choose your class", "Assault\n Sniper\n Engineer\n JetTrooper\n Pilot\n", "Choose", "Cancel");
	return 1;
}



Re: Can someone help me? - GeekSiMo - 19.07.2014

You can add this new:bool:ClassChange[MAX_PLAYERS]
Quote:

CMD:cchange(playerid, params[])
{
ClassChange[playerid] = true;
SetPlayerHealth(playerid, 0);
return 1;
}

Add This in OnPlayerSpawn
Quote:

OnPlayerSpawn(playerid)
{
if(ClassChange[playerid] = true)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Choose your class", "Assault\n Sniper\n Engineer\n JetTrooper\n Pilot\n", "Choose", "Cancel");
}
}




Re: Can someone help me? - PrinceOfPersia - 19.07.2014

It's already under it


Re: Can someone help me? - [D]ry[D]esert - 19.07.2014

Quote:
Originally Posted by PrinceOfPersia
Посмотреть сообщение
It's already under it
What do you mean exactly?


Re: Can someone help me? - PrinceOfPersia - 19.07.2014

It's under OnPlayerSpawn


Re: Can someone help me? - GeekSiMo - 19.07.2014

Just Test My Solution !!!!


Re: Can someone help me? - Laurey - 19.07.2014

Define the dialog name with something like #define DIALOG_NAME 10040 in top of your script then apply the dialog under OnPlayerDeath.
pawn Код:
CMD:cchange(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_LIST, "Choose your class", "Assault\n Sniper\n Engineer\n JetTrooper\n Pilot\n", "Choose", "Cancel");
    return 1;
}