OnPlayerRequestClass Help
#3

Код:
//add this 
new PickedClass[MAX_PLAYERS] = 0;
//under OnPlayerRequestSpawn
if(PickedClass[playerid] == 0 ) {
        ShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, "Classes", "Assault - Rank 0\nSniper - Rank 0\nPilot - Rank 3\nEngineer - rank 5\nFlameThrower - Rank 8\nMedic - Rank 4", "Select", "Cancel");
    }
// under onplayerconnect
PickedClass[playerid] = 0;
//under onplayerspawn
if(PickedClass[playerid] == 0 ) {
        ShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, "Classes", "Assault - Rank 0\nSniper - Rank 0\nPilot - Rank 3\nEngineer - rank 5\nFlameThrower - Rank 8\nMedic - Rank 4", "Select", "Cancel");
    }
//under ondialogresponse
add PickedClass[playerid] = 1; 
like this
if(dialogid == 500)
                {
                if(response)
		            {

						if(GetPlayerScore(playerid) >= 0)//Rookie
						{
					
			            gPlayerClass[playerid] = ASSAULT_CLASS;
			            SendClientMessage(playerid, COLOR_GREEN, "You chose the Assualt as your class.");
			            SendClientMessage(playerid, COLOR_GREEN, "You can type /sc to change your class again.");
			            PickedClass[playerid] = 1;

						}
                    }
Now if you want to forceclassselection then you can do PickedClass[playerid] = 0;
And not want it, then you can do  PickedClass[playerid] = 1;

example
CMD:sc(playerid, params[]) {
	PickedClass[playerid] = 0;
	SendClientMessage(playerid, COLOR_ORANGE, "You will pick your new class next death...");
	return 1;
}
Is this help you?
Reply


Messages In This Thread
OnPlayerRequestClass Help - by NinjahZ - 09.08.2013, 00:34
Re: OnPlayerRequestClass Help - by DRIFT_HUNTER - 09.08.2013, 01:29
Re: OnPlayerRequestClass Help - by Iron3man - 09.08.2013, 02:11
Re: OnPlayerRequestClass Help - by NinjahZ - 09.08.2013, 02:33
Re: OnPlayerRequestClass Help - by Iron3man - 09.08.2013, 02:54
Re: OnPlayerRequestClass Help - by NinjahZ - 09.08.2013, 05:47

Forum Jump:


Users browsing this thread: 2 Guest(s)