SA-MP Forums Archive
GetPlayerSkinID? +Rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetPlayerSkinID? +Rep (/showthread.php?tid=578519)



GetPlayerSkinID? +Rep - Rodri99 - 20.06.2015

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'


Re: GetPlayerSkinID? +Rep - SloProKiller - 20.06.2015

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


Re: GetPlayerSkinID? +Rep - Rodri99 - 20.06.2015

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...


Re: GetPlayerSkinID? +Rep - UltraScripter - 20.06.2015

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;
}



Re: GetPlayerSkinID? +Rep - AndySedeyn - 20.06.2015

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!


Re: GetPlayerSkinID? +Rep - Rodri99 - 20.06.2015

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


Re: GetPlayerSkinID? +Rep - UltraScripter - 20.06.2015

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


Re: GetPlayerSkinID? +Rep - SloProKiller - 20.06.2015

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.


Re: GetPlayerSkinID? +Rep - Konstantinos - 20.06.2015

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


Re: GetPlayerSkinID? +Rep - SloProKiller - 20.06.2015

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.