Question with format
#1

PHP код:
new IDrankstring[128]; 
PHP код:
if(rank == '1')
        {
            
PlayerInfo[playerid][nlevel] = 1;
            
format(stringsizeof(string), "You have changed %s's newb rank to helper"ID);
            
SendClientMessage(playerid, -1string);
            
format(stringsizeof(string), "Your newb rank has been set to helper by Admin %s"playerid);
            
SendClientMessage(playerid, -1string);
        }
        else if(
rank == '2')
        {
            
PlayerInfo[playerid][nlevel] = 2;
            
format(stringsizeof(string), "You have changed %s's newb rank to Advisor"ID);
            
SendClientMessage(playerid, -1string);
            
format(stringsizeof(string), "Your newb rank has been set to Advisor by Admin %s"playerid);
            
SendClientMessage(playerid, -1string);
        }
        else if(
rank == '3')
        {
            
PlayerInfo[playerid][nlevel] = 3;
            
format(stringsizeof(string), "You have changed %s's newb rank to Lead Advisor"ID);
            
SendClientMessage(playerid, -1string);
            
format(stringsizeof(string), "Your newb rank has been set to Lead Advisor by Admin %s"playerid);
            
SendClientMessage(playerid, -1string);
        } 
I use format(string) for every instance, instead of creating a string2 and so on. Will this work? And, if so, is it bad practice to do so? I was pretty sure it doesn't matter that's why I want to ask.
Reply


Messages In This Thread
Question with format - by K9IsGodly - 03.01.2016, 21:59
Re: Question with format - by saffierr - 03.01.2016, 22:08
Re: Question with format - by AndySedeyn - 03.01.2016, 22:34
Re: Question with format - by Godey - 04.01.2016, 08:59

Forum Jump:


Users browsing this thread: 1 Guest(s)