28.11.2012, 15:36
So i have been trying to make a multi-language command or whatever you want to call it.
I have a loading system that loads the language and everything works good with messages and stuff until the commands.
For example :
If my language selected is Romanian instead of saying "ERROR: You are not an administrator" i want to say
something else ( I also have some strings defines so like : EN_NOT_ADMIN is for english and RO_NOT_ADMIN for romanian ) But i can't seem to do it .. either it shows a blank line or the command doesn't work.
For english i have
And for romanian
Just in case you want to know the language thingymabob..
How can i do it and make it work..
I tried making something like this :
Doesn't work.
I have a loading system that loads the language and everything works good with messages and stuff until the commands.
For example :
pawn Код:
CMD:kick(playerid, params[])
{
new targetid, string[256], reason[128], playeridn[MAX_PLAYER_NAME], targetidn[MAX_PLAYER_NAME];
if(PlayerData[playerid][pAdmin] < 0) return SendClientMessage(playerid, -1,"ERROR: You are not an administrator");
if(sscanf(params,"is", targetid, reason)) return SendClientMessage(playerid, -1,"USAGE: /kick [targetid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1,"ERROR: Invalid targetid.");
//if(IsPlayerAdmin(tagetid)) return SendClientMessage(playerid, -1,"ERROR: You can't kick an administrator.");
GetPlayerName(playerid, playeridn, sizeof(playeridn));
GetPlayerName(targetid, targetidn, sizeof(targetidn));
format(string, sizeof(string),"Warning: %s has kicked %s from the server, reason: %s", playeridn, targetidn, reason);
SendClientMessageToAll(-1, string);
//Kick(targetid);
return 1;
}
something else ( I also have some strings defines so like : EN_NOT_ADMIN is for english and RO_NOT_ADMIN for romanian ) But i can't seem to do it .. either it shows a blank line or the command doesn't work.
For english i have
Код:
PlayerData[playerid][pLang] == 0
Код:
PlayerData[playerid][pLang] == 1
How can i do it and make it work..
I tried making something like this :
pawn Код:
if(PlayerData[playerid][pAdmin] < 0 && PlayerData[playerid][pLang] == 0) return SendClientMessage(playerid, -1,"ERROR: EN");
if(PlayerData[playerid][pAdmin] < 0 && PlayerData[playerid][pLang] == 1) return SendClientMessage(playerid, -1,"ERROR: RO");