IsValidCustomSkin
#1

can anyone give me function IsValidCustomSkin pls?
or an example to store custom skin in an array and do if(CustomSkinArray ??
Reply
#2

Quote:
Originally Posted by PowerF
Посмотреть сообщение
can anyone give me function IsValidCustomSkin pls?
or an example to store custom skin in an array and do if(CustomSkinArray ??
Код:
stock IsValidCustomSkin(skinid){
	switch(skinid){
	case 0..73,75..311,2000..30000: return true;
	}
return false;
}
Reply
#3

and how do I add skin id 74 to exception ?
Reply
#4

Quote:
Originally Posted by PowerF
Посмотреть сообщение
and how do I add skin id 74 to exception ?
id 74 is invalid skin
Reply
#5

Код:
error 002: only a single statement (or expression) can follow each "case"
warning 215: expression has no effect
warning 209: function "IsValidSkin" should return a value
error 054: unmatched closing brace ("}")
Reply
#6

Quote:
Originally Posted by PowerF
Посмотреть сообщение
this is my code
PHP код:
IsValidSkin(skin)
{
    return (
<= skin <= 311 && skin != 74);

I can't do it in 'case'
you said IsValidCustomSkin
Reply
#7

Код:
IsValidSkin(skin) return (0 <= skin <= 311 && skin != 74);
Reply
#8

I got this error now
PHP код:
error 002only a single statement (or expressioncan follow each "case"
warning 215expression has no effect
warning 209
: function "IsValidSkin" should return a value
error 054
unmatched closing brace ("}"
PHP код:
stock IsValidSkin(skinid)
{
    switch(
skinid)
    {
        case 
0..73,75..311,25000..25007,26001..26011,27001: return true;
        return 
false;
    }

Reply
#9

Quote:
Originally Posted by PowerF
Посмотреть сообщение
I got this error now
PHP код:
error 002only a single statement (or expressioncan follow each "case"
warning 215expression has no effect
warning 209
: function "IsValidSkin" should return a value
error 054
unmatched closing brace ("}"
PHP код:
stock IsValidSkin(skinid)
{
    switch(
skinid)
    {
        case 
0..73,75..311,25000..25007,26001..26011,27001: return true;
        return 
false;
    }

Код:
stock IsValidCustomSkin(skinid){
	switch(skinid){
	case 0..73,75..311,2000..30000: return true;
	}
return false;
}
test now
Reply
#10

thanks,it compiled.
but how do I make so that skin id 26001..26007 only can be used for premium?

PHP код:
stock IsValidSkin(skinid)
{
    switch(
skinid)
    {
        case 
0..73,75..311,25000..25007,27001: return true;
        case 
26001..26011//premium skins
        
{
            if(
Premium[playerid] < 2) return Error(playerid"Can't use this skin");
        }
    }
    return 
false;

you know,playerid is not defined.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)