SA-MP Forums Archive
Help with restricting a skin. - 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: Help with restricting a skin. (/showthread.php?tid=480107)



Help with restricting a skin. - EmilLykke - 08.12.2013

pawn Код:
if(id == 240 && !GetPlayerName(playerid, "Oliver_Jackson"))return SendClientMessage(playerid, RED, "This skin is restricted to Oliver Jackson ONLY.");
Can someone tell me why this is not working out?


Re: Help with restricting a skin. - StreetGT - 08.12.2013

You must use strcmp

https://sampwiki.blast.hk/wiki/Strcmp


Re: Help with restricting a skin. - cessil - 08.12.2013

you should learn how to use getplayername before you use it


Re: Help with restricting a skin. - EmilLykke - 08.12.2013

I do, just tell me what I need to do to make it work.
What I want is... I. MYSELF. Oliver Jackson. Wants me to be the ONLY person with skin id 240, so when other people try to do it, they will just get the error. How can I do that?


Re: Help with restricting a skin. - EmilLykke - 08.12.2013

I found out what the error was. This fixed it.

pawn Код:
if(skinid == 240)
                {
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    if(strcmp(name,"Oliver_Jackson",true)) return SendClientMessage(playerid, RED, "This skin is restricted to Oliver Jackson ONLY.");
                }



Re: Help with restricting a skin. - StreetGT - 08.12.2013

Quote:
Originally Posted by EmilLykke
Посмотреть сообщение
I found out what the error was. This fixed it.

pawn Код:
if(skinid == 240)
                {
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    if(strcmp(name,"Oliver_Jackson",true)) return SendClientMessage(playerid, RED, "This skin is restricted to Oliver Jackson ONLY.");
                }
No, you didn't, -> !GetPlayerName(playerid, "Oliver_Jackson") <- it's nothing...


Re: Help with restricting a skin. - EmilLykke - 08.12.2013

I know, but I still fixed it?