Skin Restricting - 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: Skin Restricting (
/showthread.php?tid=304975)
Skin Restricting -
Oh - 20.12.2011
How could I restrict certain skins with this
pawn Код:
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Skin id may be between 0 and 299.");
}
else
{
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
}
Say I wanted to restrict 4, 285, 287 and 240.
How would this be possible?
Re: Skin Restricting -
Ballu Miaa - 20.12.2011
How do you wanna restrict? U mean restrict them OnPlayerRequestClass() or in a Command like /setskin?
Re: Skin Restricting -
AstonDA-G - 20.12.2011
pawn Код:
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299) return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Skin id may be between 0 and 299.");
if(skinid == 4 || skinid == 285 || skinid == 287 || skinid == 240) return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You aren't allowed to use this skin.");
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
Untested, but should work in a /setskin cmd or whatever
-Aston
Re: Skin Restricting -
Oh - 20.12.2011
Thanks :') +rep
oh already repped you earlier, I'll get back to you.
Re: Skin Restricting -
AstonDA-G - 20.12.2011
Haha, it doesnt matter. Happy to help (for once in my life) :d