[HELP] Leveled skins?
#1

So how would I onely let a player who is say... level 2 use a certain skin?

For example, when you want to spawn as a level 2 skin,text would say "You are not level 2!"
and you would stay in the class selection screen. But if you are a level 2, then you can spawn as that skin.
Reply
#2

You charge money for projects, even large ones like your signature says but you do not know how to do a simple thing? I'm just saying..

Anyway, in OnPlayerRequestSpawn callback check if a player has the skin n and if the level is not the one you want return 0 to prevent the player from being spawned.
Reply
#3

Something like this?:

pawn Код:
command(skin2, playerid, params[])
{
    if(Player[playerid][pLevel] == 2)
    {
        SendClientMessage(playerid, -1, "You are now equipped with a level 2 skin!");
        SetPlayerSkin(playerid, PUTSKINHERE);
    }
    else return SendClientMessage(playerid, -1, "You are not level 2!");
}
< I know it's a command, but hey..

Anyways, as _Zeus said, make a function on OnPlayerRequestSpawn. Not entirely sure on how to do that. Though the skin can be easily set via commands
Reply
#4

Make an array,
PHP код:
new skins[] []=
{
     {
skinid,requiredlevel},
     {
0,3},
     {
1,4},
     {
2,5}//Note this will only work if you do all skins in the order they are in where you use AddPlayerClass
}
public 
OnPlayerRequestClass(playerid,classid)
{
    new 
level PlayerInfo[playerid][pLevel];
    if(
skins[classid][1] > level
    {
          new 
string[128];
          
format(string,sizeof(string),"You need to be at least level %d to use this skin",skins[classid][1]);
          
SendClientMessage(playerid,-1,string);
          return 
0;
        
    }
    return 
1;

this code is untested but that should give you a basic idea on how to do it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)