Class names
#1

Hi, can somebody help me with making classes names.
To show OnPlayerRequestClass skin names,For example:
When the player switch to skinid - 0 to show him with GameTextForPlayer - "CJ" , classid - 86 "Ryder".
And special skins only for admins for example skinid 294 (woozie) to show to non-admin players error:You must be an administator to use this skin!
Reply
#2

pawn Code:
new gClassNames[][] = {
"Carl Johnson (CJ)", // ID 0
"The Truth", // ID 1
"Maccer", // ID 2
// etc.
};

public OnPlayerRequestClass(playerid, classid)
{
    GameTextForPlayer(playerid, gClassNames[GetPlayerSkin(playerid)], 3000, 3);
    return 1;
}
That should start you off.
Reply
#3

pawn Code:
#include <a_samp>
public OnPlayerRequestClass(playerid)
{
    new playerskin = GetPlayerSkin(playerid);
    if(playerskin == 0) {
        GameTextForPlayer(playerid,"CJ",3000,1);
    }
    else if(playerskin == 86) {
        GameTextForPlayer(playerid,"Ryder",3000,1);
    }
    return 1;
}


public OnPlayerRequestSpawn(playerid)
{
    new playerskin = GetPlayerSkin(playerid);
    if(playerskin == 0) {
        if(!IsPlayerAdmin(playerid))
            return 0;
    }
    return 1;
}
Reply
#4

tyler, it's better to use arrays. That looks messy and will be almost impossible to alter down the line.
Reply
#5

Quote:
Originally Posted by MP2
View Post
tyler, it's better to use arrays. That looks messy and will be almost impossible to alter down the line.
I know but he only wants for certain skins, dont think he will want to go through all the skins.
Reply
#6

Quote:
Originally Posted by tyler12
View Post
I know but he only wants for certain skins, dont think he will want to go through all the skins.
Yes I realy will do that for certain skins.I won't set all 300 skins in my GM.

P.S:This is Spartaaa!
Reply
#7

He/you didn't say you only wanted certain skins to have names. At least use switch().
Reply
#8

Btw I wanted also one more thing,but I forget to tell you,to set different skins at different SetPlayerPos -es.I won't use SetCameraPos and SetCameraLookingAt functions I'll use InterpolateCameraPos.
Reply
#9

pawn Code:
public OnPlayerRequestClass(playerid)
{
new playerskin = GetPlayerSkin(playerid);
if(playerskin == 0)
{
GameTextForPlayer(playerid,"CJ",3000,1);
SetPlayerCameraLookAt(playerid,0,0,0);
}
else if(playerskin == 86)
{
GameTextForPlayer(playerid,"Ryder",3000,1);
//w/e here
}
return 1;
}
Reply
#10

Thank you for tha help!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)