Locking a class...
#1

Hello there,

I would like to know how to lock a class and make it for only certain people, If you know what I mean, so like for the chosen names. For example I am making a truck company and I would like to make it only for some people. Is it possible? If yes, how?

Thanks and Regards
Puzi
Reply
#2

I do not believe the inbuilt class system allows for "locking" of a class, but you could simply check the players skin in the "OnPlayerRequestSpawn" callback and return zero if the player is not allowed to use that skin.
Reply
#3

Quote:
Originally Posted by ferriswheel
I do not believe the inbuilt class system allows for "locking" of a class, but you could simply check the players skin in the "OnPlayerRequestSpawn" callback and return zero if the player is not allowed to use that skin.
Well, that would lock all players I guess from choosing the skin, am I correct?
I want it only for certain people, like after their names, for example I (Puzi) would be allowed to choose the skin, but Player would not, if you get what I mean
Reply
#4

You would have to setup some sort of account system, checking the name would mean anyone could set their name to "Puzi" and then join the server and select any class. Do a search on the forums for a registration system or admin system if you are unable to script your own.
Reply
#5

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    if(GetPlayerSkin(playerid) == YOUR_SKIN_ID_HERE && strcmp(playername, "Puzi") != 0) // replace YOUR_SKIN_ID_HERE
    {
      return 0;
    }
    return 1;
}
Reply
#6

Doesn't work I'm afraid.
Reply
#7

Please explain, what happens that makes it "not work"?
Reply
#8

YOUR_SKIN_ID_HERE
Does that mean entering the Class ID like 0 or Skin ID which would be on Class 0 76? I think that's wrong...

When I choose the Class 0, it just spawns with even I have a different nick.
Reply
#9

It means the skin id, 0 being CJ.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)