help code
#1

help my code please
Код:
new str[57];
format(str, sizeof(str), "OrganizationInfo[%d][Skin%d]", idorg, playerInfo[playerid][pRank]);
SetPlayerSkin(playerid, str);
error
Код:
error 035: argument type mismatch (argument 2)
Reply
#2

The second parameter of SetPlayerSkin is an integer. You can convert a string to an integer by using strval; however, you cannot do that with the str because of its text.

So what do you want to do?
Reply
#3

I want to do that would be based on the rank of the player to give the skin that is stored in my database.
Reply
#4

You'll need to make a function for it to easier set the skin.

For example:
pawn Код:
stock ReturnRankSkin( rank )
{
    new
        skinid
    ;
    switch( rank )
    {
        case 0: skinid = 269;
        case 1: skinid = 270;
        default: skinid = 1;
    }
    return skinid;
}
If the rank is 0, then it returns 269.
Else if the rank is 1, then it returns 270.
Else it returns 1.

You can modify it to your needs, that was just an example.
pawn Код:
SetPlayerSkin(playerid, ReturnRankSkin(playerInfo[playerid][pRank]));
Reply
#5

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)