getplayerskin help - 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: getplayerskin help (
/showthread.php?tid=440585)
getplayerskin help -
Proph3t - 30.05.2013
Hello,
I want to know how to i change players skin with GetPlayerSkin? i tried this:
if(GetPlayerSkin(294)) return SetPlayerSkin(playerid, 270);
basicly i want if the players skin id is 294 i want the server to change it to 270. help please?
Re: getplayerskin help -
[ABK]Antonio - 30.05.2013
Quote:
Originally Posted by Proph3t
Hello,
I want to know how to i change players skin with GetPlayerSkin? i tried this:
if(GetPlayerSkin(294)) return SetPlayerSkin(playerid, 270);
basicly i want if the players skin id is 294 i want the server to change it to 270. help please?
|
https://sampwiki.blast.hk/wiki/GetPlayerSkin
As you can see from there, it's expecting the players ID. So you can do something like;
pawn Код:
if(GetPlayerSkin(playerid) == 294) SetPlayerSkin(playerid, 270);
Re: getplayerskin help -
NL-Sultan - 30.05.2013
Maybe this will work.
pawn Код:
new skin = GetPlayerSkin(playerid); // Put this on the TOP of the script.
// This under OnPlayerStateChange
if(skin == 294) // If the skin equals 294
{
SetPlayerSkin(playerid, 270); // Sets the skin back to 270.
SendClientMessage(playerid, YourColorID, "This skin is restricted."); // Text when changing skin to 270.
return 1;
}
}
Re: getplayerskin help -
Konstantinos - 30.05.2013
Quote:
Originally Posted by NL-Sultan
Maybe this will work.
pawn Код:
new skin = GetPlayerSkin(playerid); // Put this on the TOP of the script.
// This under OnPlayerStateChange
if(skin == 294) // If the skin equals 294 { SetPlayerSkin(playerid, 270); // Sets the skin back to 270. SendClientMessage(playerid, YourColorID, "This skin is restricted."); return 1; } }
|
You cannot add skin as a global variable like that, because playerid is undefined variable. Furthermore, OnPlayerStateChange has nothing to do with the skins, I'd recommend to check in OnPlayerSpawn if the skin id 294 and then set it to 270 as you wish!
Re: getplayerskin help -
[ABK]Antonio - 30.05.2013
Hmm, what are you even trying to use this for? Are you trying to stop people from spawning as a certain class? Are you trying to make it so admins can't set their skin to certain IDs? Is it for an anti-cheat?
Re: getplayerskin help -
Proph3t - 30.05.2013
No, i have a closed source script and i wanted to change the skin from a certain thing.
thank you