Redefining something..
#1

I'm doing something like this ( example )

pawn Код:
#define SOMETHING 1
#define SOMETHING2 2

static result[MAX_PLAYERS];

public OnPlayerRequestClass(playerid,classid)
{
    switch(GetPlayerSkin(playerid))
    {
        case 9:result[playerid] = SOMETHING;
    case 10:result[playerid] = SOMETHING;
    case 11:result[playerid] = SOMETHING;
    case 12:result[playerid] = SOMETHING;
        default:result[playerid] = SOMETHING2;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new string[45];
    format(string,sizeof string,"Your skin is %s",result);
    SendClientMessage(playerid,-1,string);
    return 1;
}
But it says Your skin is
And no more... then i change %s ti %d and it says Your skin is 1 or 2 , but i want that it says
Your skin is SOMETHING
or
Your skin is SOMETHING2

->I don't want numbers i want the word <-

Sorry bad english
Reply
#2

You mean something like
pawn Код:
#define SOMETHING "This is something number 1"
not sure if that what you mean
Reply
#3

Umm yes i tried it but i'm giving a value to each case so it gave me errors...
Reply
#4

i think in this case, you'll have to use enum.
EDIT:
Example:
pawn Код:
enum skins_
{
    skinname[10],
    skinid
}
new skins[][skins_] =
{
    {"CJ skin"/*Skin name*/,0/*Skinid*/}
     
   
};
new pskin[MAX_PLAYERS][skins];
Reply
#5

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
i think in this case, you'll have to use enum.
enums don't do what you think they do..
Reply
#6

Nice example but i want an example to use it ( example a format / message)
Reply
#7

Quote:
Originally Posted by Ada32
Посмотреть сообщение
enums don't do what you think they do..
ehum ? what do you mean lol, then say how to do that? i know there are many ways to do it, but im completely lazy to make..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)