PDA

View Full Version : how to make a skin for vip only


1fret
09/03/2014, 01:26 AM
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.

SyntaxQ
09/03/2014, 04:15 AM
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);
}

1fret
09/03/2014, 04:28 AM
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

r3ct
09/03/2014, 04:58 AM
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;
}

1fret
09/03/2014, 05:38 AM
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

1fret
09/03/2014, 03:43 PM
Bump

1fret
09/03/2014, 06:36 PM
Bump

ZeroTheScyther
09/03/2014, 08:12 PM
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]

1fret
09/03/2014, 08:14 PM
Thanks guys

1fret
11/03/2014, 11:48 PM
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(438) : error 010: invalid function or declaration