Skin Restricting
#1

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?
Reply
#2

How do you wanna restrict? U mean restrict them OnPlayerRequestClass() or in a Command like /setskin?
Reply
#3

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
Reply
#4

Thanks :') +rep

oh already repped you earlier, I'll get back to you.
Reply
#5

Haha, it doesnt matter. Happy to help (for once in my life) :d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)