Question about class selection
#1

I've noticed in CrazyBob's Cops and Robbers. He has made it so the class selection list can vary depending on the player. For example if a player is already registered and he enters the server, the only class in the class list is the one he had orginally chosen when registered. How is it possible to do this? Doesn't AddPlayerClass works as a function globally to all players? How can it show only specific classes for specific players?
Reply
#2

I believe you can use SetPlayerSkin in OnPlayerRequestClass, so for example:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    // If the player has no saved skin, lets say -1 means no saved skin for
    // an example. Then set the player to their saved skin, you'll probably need
    // to use SetPlayerSkin in OnPlayerSpawn or ...
    if (playerSavedSkin[playerid] != -1)
    {
        SetPlayerSkin(playerid, playerSavedSkin[playerid]);

        // ... you can use SetSpawnInfo in here (or OnPlayerRequestSpawn)
        // if you don't want to worry about setting the skin every time the
        // player spawns.
        // SetSpawnInfo(playerid, playerid, playerSavedSkin[playerid], ...);
    }
}
Reply
#3

Ahh yeah I see what your saying. Thanks for clearing that up for me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)