GetPlayerSkinID? +Rep
#1

How to get the skinid of a player using stock or a function?
I used the 'modelid' variable of public OnPlayerModelSelection(playerid, response, listid, modelid), but on game show a long number and not the id of the skin of the player, how can i fix it?

if(listid == skinlist)
{
if(response)
{
SetPlayerSkin(playerid, modelid);
SendClientMessage(playerid, green, "- Skin successufly changed to ID: %d for 200$ -", HERE);
GivePlayerMoney(playerid, -200);
}
else SendClientMessage(playerid, red, "Skin selection aborted");

Thanks to all,
Rodrigo Dionigi aka 'Rodri'
Reply
#2

You mean this? https://sampwiki.blast.hk/wiki/GetPlayerSkin
Reply
#3

I mean get the skin ID, of a player, that command is to watch which skin he has, but it doesnt get anything to put in an ipotetic 'string'.
Mistake impossible to solve...
Reply
#4

try this
pawn Код:
if(listid == skinlist)
{
if(response)
{
SetPlayerSkin(playerid, modelid);
SetTimerEx("SkinID", 1000, false, "i", playerid);
GivePlayerMoney(playerid, -200);
}
else SendClientMessage(playerid, red, "Skin selection aborted");

forward SkinID(playerid);

public SkinID(playerid)
{
   new Str[64];
   format(Str, 64, "Skin: %d", GetPlayerSkin(playerid));
   SendClientMessage(playerid, -1, Str);
   return 1;
}
Reply
#5

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
try this
pawn Код:
if(listid == skinlist)
{
if(response)
{
SetPlayerSkin(playerid, modelid);
SetTimerEx("SkinID", 1000, false, "i", playerid);
GivePlayerMoney(playerid, -200);
}
else SendClientMessage(playerid, red, "Skin selection aborted");

forward SkinID(playerid);

public SkinID(playerid)
{
   new Str[64];
   format(Str, 64, "Skin: %d", GetPlayerSkin(playerid));
   SendClientMessage(playerid, -1, Str);
   return 1;
}
You are missing a bracket. Why do you use a timer for that? And if you were to use one, why would you give the format variable an extra 58 bits? The maximum length of that format is 9 characters!
Reply
#6

Thanks UltraScripter you solved it !!!!!!!! Thanks again man, +Rep done
Reply
#7

Quote:
Originally Posted by Rodri99
Посмотреть сообщение
Thanks UltraScripter you solved it !!!!!!!! Thanks again man, +Rep done
yw
Reply
#8

Why would you need a timer for this? Surely just adding GetPlayerSkin into a format would do the trick?
Код:
if(listid == skinlist)
{
    if(response)
    {
        new tmpString[128];
        SetPlayerSkin(playerid, modelid);
        format(tmpString, sizeof(tmpString), "- Skin successufly changed to ID: %d for 200$ -", GetPlayerSkin(playerid));
        SendClientMessage(playerid, green, tmpString);
        GivePlayerMoney(playerid, -200);
    }
    else SendClientMessage(playerid, red, "Skin selection aborted");
}
A timer is a very inefficient way to go about this.
Reply
#9

You wouldn't even need to call GetPlayerSkin as "modelid" holds the skinid.
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You wouldn't even need to call GetPlayerSkin as "modelid" holds the skinid.
Yep, that would work as well and would be ideal.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)