Stock Variable?
#1

Heey all,
How can i make a stock thats detect if variable is 1 or 0 and changes a text?
Explain:
Код:
new clothes1[MAX_PLAYERS]=0;//clothes id 1

stock hasclothes1(variable)//detects variable id 0 or 1??
{
	static variable;
    switch(clothes1)
    {
        case 0: strcat(variable, "has no clothes1");//if clothes1[playerid]=0 then the text is has no clothes
        case 1: strcat(variable, "has clothes1");//if clothes1[playerid]=1 then the is has clothes
	}
	return variable;
}
Why i need this?
Because i want to make this for my clothes system. Like a command /myclothes.

I hope you know what i mean.
For myself this is a hard code to:P

Thanks Admigo
Reply
#2

pawn Код:
new clothes1[MAX_PLAYERS;

stock hasclothes1(playerid)
{
    new istr[15];

    if(clothes1[playerid] == 1) istr = "has clothes1";
    else if(clothes1[playerid] == 0) istr = "has no clothes1";

    return istr;
}

Usage:

printf("%s %s", pname(playerid), hasclothes1(playerid));
Reply
#3

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
new clothes1[MAX_PLAYERS;

stock hasclothes1(playerid)
{
    new istr[15];

    if(clothes1[playerid] == 1) istr = "has clothes1";
    else if(clothes1[playerid] == 0) istr = "has no clothes1";

    return istr;
}

Usage:

printf("%s %s", pname(playerid), hasclothes1(playerid));
Omg!Thank you so much! Works great!!!! Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)