how to make a skin for vip only
#1

hey , the title says it all,but if you dont understand i need to set a skin for vips only so if an normal player chose that skin they will recieve a message saying "you need to be an donor to use this skin" and they will have to choose another skin. I search for a tutorial but i couldn't find one so please can someone help me.
Reply
#2

pawn Код:
CMD:skin (playerid, params[])
{
        new skinid, str[128];
    if ( sscanf( params, "d", skinid )) return SendClientMessage( playerid, 0x6FFF00FF, "{F07F1D}USAGE:         {BBFF00}/skin <ID>" );
    if (skinid == 23) return SendClientMessage(playerid, -1, "ERROR: You need to be a donor to use this skin!"); // I'm taking 23 as a VIP skin, you can use any skin you want..
    if (skinid < 0 || skinid > 299) return SendClientMessage(playerid, -1,"{FA002E}ERROR: {C7BDBF}Your skin ID parameter should be between 0 - 299!");
    SetPlayerSkin(playerid, skinid);
    format(str,sizeof(str),"{F6C73B}[SKIN] {5896ED}You have changed your skin ID to {F07F1D}%d{5896ED}!", skinid);
    SendClientMessage(playerid, -1, str);
}
Reply
#3

Thanks for the quick response but i didnt need a command.I mean Onplayerrequestclass if he choose the donor skin it wont spawn because he's not a donor
Reply
#4

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
          if(IsADonatorSkin(classid) && pDonator[playerid] == false)
          {
                SendClientMessage(playerid,0x00FF00FF,"You're not a donator you can't use this skin");
                return 0;
          }
          return 1;        
}

stock IsADonatorSkin(skinid)
{
    switch(skinid)
    {
         case 0,74,299: return 1;//add all the skins you want locked to donators here.
    }
    return 0;
}
Reply
#5

Quote:
Originally Posted by r3ct
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
          if(IsADonatorSkin(classid) && pDonator[playerid] == false)
          {
                SendClientMessage(playerid,0x00FF00FF,"You're not a donator you can't use this skin");
                return 0;
          }
          return 1;        
}

stock IsADonatorSkin(skinid)
{
    switch(skinid)
    {
         case 0,74,299: return 1;//add all the skins you want locked to donators here.
    }
    return 0;
}
I tried that script but i still get errors saying pdonator undefine so i did."new pDonator[MAX_PLAYERS];"and i get 1 warning saying it is mismatch can any one tell me what im doing wrong are is there any other suggestion
Reply
#6

Bump
Reply
#7

Bump
Reply
#8

Quote:
Originally Posted by 1fret
Посмотреть сообщение
I tried that script but i still get errors saying pdonator undefine so i did."new pDonator[MAX_PLAYERS];"and i get 1 warning saying it is mismatch can any one tell me what im doing wrong are is there any other suggestion
You don't have to #define it, you have to change it to the variable you use to check if he's donor,vip or whatever. Like on my server I use something like PlayerInfo[playerid][pAdmin] and PlayerInfo[playerid][pVip]
Reply
#9

Thanks guys
Reply
#10

sorry for bumping but i have a problem with this

if(vip[playerid] >= 0)// this is my vip checker

if(IsADonator(classid) && if(vip[playerid] >= 0)
{
SendClientMessage(playerid,0x00FF00FF,"You're not a donator you can't use this skin");
return 0;
}
return 1;
}


errors:

C:\Users\Public\Pictures\Sample Pictures\pic 1\samp server 2\gamemodes\lskz.pwn(433) : error 029: invalid expression, assumed zero
C:\Users\Public\Pictures\Sample Pictures\pic 1\samp server 2\gamemodes\lskz.pwn(433 -- 435) : error 001: expected token: "}", but found ";"
C:\Users\Public\Pictures\Sample Pictures\pic 1\samp server 2\gamemodes\lskz.pwn(436) : warning 217: loose indentation
C:\Users\Public\Pictures\Sample Pictures\pic 1\samp server 2\gamemodes\lskz.pwn(43 : error 010: invalid function or declaration
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)