Where can I use AddPlayerClass other than OnGamemode/FilterscriptInit?
#1

I have 300 skins under OnGamemodeInit
pawn Код:
for(new skins = 0, skins2 = 300; skins < skins2; skins++)
    {
        AddPlayerClass(skins, 1544.7887,-1675.4630,13.5591, 90.0, 0, 0,0 ,0,0,0);
    }
It shows skin 0, 1, 2, ... 299 as I scripted it that way. But I want to show, let's say 29 first (depends on player's saved skin), then 0, 1, 2, 3, ... How am I gonna do that? I've tried adding AddPlayerClass(pInfo[playerid][Skin], 1544.7887,-1675.4630,13.5591, 90.0, 0, 0,0 ,0,0,0) under OnPlayerRequestClass, but no luck.
Reply
#2

What you wanna do, exactly?
Reply
#3

Showing saved player's skin(from sql/ini) in class selection first, then skin 0, 1, 2, 3... 299 when player clicks >>
Reply
#4

You can do something like -

pawn Код:
new someSkin = 12; // A skin you want to hide

public OnPlayerRequestClass(playerid,classid)
{
    if(classid == someSkin)
    {
        SetPlayerSkin(playerid, classid + 1); // Skip that classID
    }
    return 1;
}
Untested, but COULD work.
Reply
#5

I don't think it's possible to change the classes after they've been created.

The only possible way is SetPlayerSkin. After logging in, set the skin to the saved one and if the player clicks on the next skin, use GetPlayerSkin and check if the skinid is the saved one + 1 and set it to 0. Else if the player clicks on the previous skin, get the skin and if it's the saved one - 1, then set to 299.

Note that skinid 74 is not valid, so in the loop:
pawn Код:
if (skins == 74) continue;
above AddPlayerClass line.
Reply
#6

Actually it is possible Konstantinos. I've got this idea from Rajat_Pawar's code.
pawn Код:
AddPlayerClass(74, 1544.7887,-1675.4630,13.5591, 90.0, 0, 0,0 ,0,0,0);
    for(new skins = 0, skins2 = 300; skins < skins2; skins++)
    {
        AddPlayerClass(skins, 1544.7887,-1675.4630,13.5591, 90.0, 0, 0,0 ,0,0,0);
    }

//requestclass
    if(classid == 0) SetPlayerSkin(playerid, pInfo[playerid][Skin]); //if classid 0 or skin 74, replace with saved skin
But, for some reason, it hides Claude's skin :/
EDIT: Ok, I have fixed it by just adding if(skins == 74) continue;
Server only shows 300 skins. I have 301 skins. So adding ^ makes it 300
Reply
#7

It is possible, but currently the only way to change the skin selection screen after a player connects is with y_classes.
Reply
#8

Quote:
Originally Posted by ColeMiner
Посмотреть сообщение
It is possible, but currently the only way to change the skin selection screen after a player connects is with y_classes.
Thanks. But I have figured out the another way. Check your above post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)