Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Well, assuming it's a global variable, it should work.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
It should work too, would you elaborate more and tell me what you're trying to do?
Edit: I got to go to bed, you take too long to respond..
Posts: 277
Threads: 40
Joined: Sep 2012
Reputation:
0
new string[250];
switch(reason){
case 0: format(string,sizeof(string),"*Player %s(id:%d) has left the server [Leaving]",GetName(playerid),playerid);
case 1: format(string,sizeof(string),"*Player %s(id:%d) has left the server [Timeout]",GetName(playerid),playerid);
case 2: format(string,sizeof(string),"*Player %s(id:%d) has left the server [Kicked/Banned]",GetName(playerid),playerid);}
SendClientMessageToAll(0x696969AA,string);
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
return name;
}
Posts: 686
Threads: 29
Joined: Feb 2011
Reputation:
0
Logically, changing variables works anywhere as long as it's within their scope.
Also, always use switch case statements over if statements when you can, as they have a shorter run time.