how to make a skin for vip only -
1fret - 09.03.2014
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.
Re: how to make a skin for vip only -
SyntaxQ - 09.03.2014
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);
}
Re: how to make a skin for vip only -
1fret - 09.03.2014
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
Re: how to make a skin for vip only -
r3ct - 09.03.2014
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;
}
Re: how to make a skin for vip only -
1fret - 09.03.2014
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
Re: how to make a skin for vip only -
1fret - 09.03.2014
Bump
Re: how to make a skin for vip only -
1fret - 09.03.2014
Bump
Re: how to make a skin for vip only -
ZeroTheScyther - 09.03.2014
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]
Re: how to make a skin for vip only -
1fret - 09.03.2014
Thanks guys
Re: how to make a skin for vip only -
1fret - 11.03.2014
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