SA-MP Forums Archive
How? Help rep+ - 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: How? Help rep+ (/showthread.php?tid=542674)



How? Help rep+ - MasonSFW - 21.10.2014

How I make second onplayerrequestspawn i tried to make


pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(Player[playerid][pSelected] == 0)
    {
        if(IsPlayerEmptySpawn[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_BLUELIGHT , "choose you base to spawn." );
            IsPlayerEmptySpawn[playerid] = 0;
        }
        switch(classid)
        {
            case 0:
            {
                SetPlayerCameraPos(playerid, 918.3123, 1375.9882, 90.1765);
                SetPlayerCameraLookAt(playerid, 919.1430, 1375.4242, 89.7315);
                SetPlayerPos(playerid, 820.0000, 1075.0000, 199.0000);
            }
            case 1:
            {
                SetPlayerCameraPos(playerid, 487.0484, 2545.9292, 63.6614);
                SetPlayerCameraLookAt(playerid, 486.1133, 2545.5620, 63.2165);
                SetPlayerPos(playerid, 820.0000, 1075.0000, 199.0000);
            }
        }
    }
    return OnPlayerRequestClassEx(playerid, classid);
}
It skip call only OnPlayerRequestClassEx but i need to make player select base if players selected call OnPlayerRequestClassEx, Help please


Re: How? Help rep+ - EnforcerDon - 21.10.2014

please be more specific, I am having difficulty understanding exactly what is it you want.


Re: How? Help rep+ - MasonSFW - 21.10.2014

I need second OnPlayerRequestClass like OnPlayerRequestClassEx

1. i want to made players select spawn on OnPlayerRequestClass
2. If players done selected spawn on OnPlayerRequestClass will select skins on OnPlayerRequestClassEx

ok ?


Re: How? Help rep+ - Rudy_ - 21.10.2014

No, Select Spawns on OnPlayerRequestClass and then select Players Spawn (Position/location 'if that's what you mean) After player spawns....


Re: How? Help rep+ - EnforcerDon - 21.10.2014

I see what you want to do, and you can't do it like that. You have to use the OnPlayerKeyChangeState or similar (a callback that handles user input will be required) To select which city to spawn from. The call to OnPlayerRequestClassEx(playerid, classid) will set up the textdraws, and then a player input callback will handle the selection.

And btw, its easier to do the spawn location before the class selection, else you have to interrupt the call to OnPlayerSpawn.


Re: How? Help rep+ - TwinkiDaBoss - 21.10.2014

Best way is to do it old fashioned way. Lets say they pick their class and everything and then spawn them at lets say 0,0,0. Show them Spawn options and once they pick their spawn, use SetPlayerPos