SA-MP Forums Archive
symbol already defined and symbol is assigned - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: symbol already defined and symbol is assigned (/showthread.php?tid=586211)



symbol already defined and symbol is assigned - PowerF - 20.08.2015

Code:
 error 021: symbol already defined: "string"
 warning 204: symbol is assigned a value
Code:
   
   new city[54],
    string[128];
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerCity(playerid, city, sizeof(city));
    format(string, sizeof(string), "%s {00FFF7}Has Been joined to server (%s).", name, city);
    SendClientMessageToAll(-1, string);



Re: symbol already defined and symbol is assigned - 1nspire - 20.08.2015

PHP Code:
 new city[54],
    
string[128]; <----- remove THIS
    
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerCity(playeridcitysizeof(city));
    
format(stringsizeof(string), "%s {00FFF7}Has Been joined to server (%s)."namecity);
    
SendClientMessageToAll(-1string); 
PHP Code:
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME], city[54];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerCity(playeridcitysizeof(city));
    
format(stringsizeof(string), "%s {00FFF7}Has Been joined to server (%s)."namecity);
    
SendClientMessageToAll(-1string);