Help with restricting a skin.
#1

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

You must use strcmp

https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

you should learn how to use getplayername before you use it
Reply
#4

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

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.");
                }
Reply
#6

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

I know, but I still fixed it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)