27.11.2018, 17:17
Hello, i have this command and i want to make these variables ( if pFaction == 0) format(the name )
In this command the names for factions are locals, in this command, and i want to make them globals to use them on another commands. And i dont want to define everytime in every command the names of the factions.
In this command the names for factions are locals, in this command, and i want to make them globals to use them on another commands. And i dont want to define everytime in every command the names of the factions.
Код:
CMD:stats(playerid, params[]) { new string[128], fNume[128]; SCM(playerid, 0xFFD080FF, "___________________________________"); SCM(playerid, -1, ""); if(PlayerInfo[playerid][pFaction] == 0) format(fNume, 128, "Civil"); if(PlayerInfo[playerid][pFaction] == 1) format(fNume, 128, "Police Departament"); if(PlayerInfo[playerid][pFaction] == 2) format(fNume, 128, "Paramedic Departament"); if(PlayerInfo[playerid][pFaction] == 3) format(fNume, 128, "Taxi Company"); format(string, sizeof(string), "{FFD080}%s{E6E6E6}: Level: {FFD080}%d {E6E6E6}| Faction: {FFD080}%s {E6E6E6}| Ping:{FFD080}%d", GetName(playerid), GetPlayerScore(playerid), fNume, GetPlayerPing(playerid)); SCM(playerid, 0xFFD080FF, string); SCM(playerid, 0xFFD080FF, "___________________________________"); return 1;