2 Questions on OnPlayerRequestClass
#1

1st question

How do I do that when instead a Player chooses class through the normal class selection menu, instead I want a dialog based?

like

Код:
ShowPlayerDialog(playerid,57,DIALOG_STYLE_LIST,"Class Select","Trucker\nBus Driver\nBoat Man\nPolice","Select", "");
then ofcourse, each class has it's own skin and has a score required like for example

Dialog:
Код:
Class Select:
Trucker - 0 Score
Bus Driver - 30 Score
Boat Man - 60 Score
Police - 100 Score
That brings us to the next question
Question number 2:
How do I implement a required score on class selection?

like the following:

Dialog:
Код:
Class Select:
Trucker - 0 Score
Bus Driver - 30 Score
Boat Man - 60 Score
Police - 100 Score
Do I need to use
Код:
if(GetPlayerScore) > 0
or something like that?, can you cite an example of how or where do i implement the score requirement on class selection?
Reply
#2

You could try doing this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid);
    return 1;
}
And then between the SpawnPlayer and return 1; add your dialog system. That should work but haven't been able to test it.
Reply
#3

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
You could try doing this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid);
    return 1;
}
And then between the SpawnPlayer and return 1; add your dialog system. That should work but haven't been able to test it.
Yes thank you it works. But one problem (sorry for being a noob), the arrows and spawn select on the bottom, how do I remove it?
Reply
#4

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   TogglePlayerSpectating(playerid, 1);
   return 1;
}

public OnPlayerSpawn(playerid)
{
   TogglePlayerSpectating(playerid, 0);
   return 1;
}
This should remove it, also I haven't tried this either but I heard it's worth a shot.
Reply
#5

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   TogglePlayerSpectating(playerid, 1);
   return 1;
}

public OnPlayerSpawn(playerid)
{
   TogglePlayerSpectating(playerid, 0);
   return 1;
}
This should remove it, also I haven't tried this either but I heard it's worth a shot.
It does work but, I can't choose a class anymore from the dialog (once i choose which one from the dialog, nothing happens)
Reply
#6

Have you linked any responses to it for when your changing the classes because if you haven't it wouldn't work either way.
Reply
#7

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
Have you linked any responses to it for when your changing the classes because if you haven't it wouldn't work either way.
Yes ofcourse
Reply
#8

simple
add the class dialog in OnPlayerConnect(playerid) and put if(GetPlayerScore(playerid)>0; in dialog respose of class selection
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)