Integer convert to String
#4

pawn Код:
CMD:mylevel(playerid, params[])
{
    new level[128];
    switch(pInfo[playerid][Admin]) // Checks the value of pInfo[playerid][Admin]
    {
        case 1: level = "level 1"; // If it's 1, the level-array contains "level 1"
        case 2: level = "level 2"; // If it's 2, the level-array contains "level 2"
        // And so on
    }
    new string[128];
    format(string, sizeof(string), "Server: Your level is %s", level); // You need to use format to have other formats in your message, etc. %s, %d and so on
    SendClientMessage(playerid, -1, string);
    return 1;
}
Or just put the switch in a function instead.
Reply


Messages In This Thread
Integer convert to String - by Genmetal - 02.04.2015, 14:42
Re: Integer convert to String - by Vince - 02.04.2015, 14:45
Re: Integer convert to String - by Jimmy0wns - 02.04.2015, 14:45
Re: Integer convert to String - by CalvinC - 02.04.2015, 14:49
Re: Integer convert to String - by Genmetal - 02.04.2015, 14:50
Re: Integer convert to String - by Genmetal - 02.04.2015, 14:56
Re: Integer convert to String - by PT - 02.04.2015, 14:57

Forum Jump:


Users browsing this thread: 1 Guest(s)