Languages System problem and some questions
#1

Hi guys i have a little question, today iґve started to made an Languages System for my server so i have started with some if questions i Want that english users get english messages and german german messages. So can i have test this

Код:
if (englisch[playerid] == 1)
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s is at San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
else
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s ist bei San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
if it works i would put it in the /sfp command

I will that all users who use the english language (englisch[playerid] == 1) get the english clientmessage when a is at /sfp
all other german user who use the german language }else{ get the german clientmessage

so can someone give me a quickly answer please if i can use this code
Reply
#2

Why don't you test it?
Reply
#3

Quote:
Originally Posted by Antoni0
so can someone give me a quickly answer please if i can use this code
Why do you think you have a PAWN compiler? Compile it and test it yourself. But anyways, you could try the YSI language system.
Reply
#4

i dont like finished scrips so much , selfmade ftw
the problem is that iґm not not at my home PC, iґm at my grandfather house to show him skype. iґve mad it with the normal windows editor so i didnґt have pawn to
Reply
#5

it should work, if you have the right variable at the top.

pawn Код:
new language[MAX_PLAYERS];
pawn Код:
switch(language[playerid])
case 0:
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s ist bei San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
case 1:
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s is on San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
}
this way you could use more languages.
Reply
#6

Thx Knool

hmm ok it didnґt work because if he is english he only send the english message to all players but i want that the english users get the english message hmm
sa-mp didngґt have a getclientmessage function right ?
Reply
#7

Post your whole command so I can help you more about this.
Reply
#8

Код:
if(strcmp(cmdtext, "/sfp", true) == 0)
{
if(derbygodupfuck[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im Derby zum verlassen tippe /derbyex");
if(DMZone[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im DM Modus zum verlassen tippe /dmex");
new string[100];
new cmdname[MAX_PLAYER_NAME];
new cartype=GetPlayerVehicleID(playerid);
SetPlayerInterior(playerid,0);

if (englisch[playerid] == 1)
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s is at San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
else
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s ist bei San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}

if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2680.3997,1340.7634,16.9978);
SetVehicleZAngle(cartype,268.0079);
}
else
{
SetPlayerPos(playerid, -2680.3997,1340.7634,16.9978);
}
return 1;
}
here is it ^^
Reply
#9

On top of your script under includes/defines:
pawn Код:
new language[MAX_PLAYERS];
pawn Код:
if(strcmp(cmdtext, "/sfp", true) == 0)
{
if(derbygodupfuck[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im Derby zum verlassen tippe /derbyex");
if(DMZone[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im DM Modus zum verlassen tippe /dmex");
new string[100];
new cmdname[MAX_PLAYER_NAME];
new cartype=GetPlayerVehicleID(playerid);
SetPlayerInterior(playerid,0);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) {
switch(language[i])
case 0:
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s ist bei San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
case 1:
{
GetPlayerName(playerid, cmdname, sizeof(cmdname));
format(string, sizeof(string), ">>> %s is on San fierros puff /sfp <<<", cmdname);
SendClientMessageToAll(0xF17A26FF, string);
}
}
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2680.3997,1340.7634,16.9978);
SetVehicleZAngle(cartype,268.0079);
}
else
{
SetPlayerPos(playerid, -2680.3997,1340.7634,16.9978);
}
return 1;
}
Reply
#10

ok it looks very nice so my other question is now how i can change the language per command so if a player type for example /english he will get the messages from the sekond case ?

with

language[playerid] = 1; ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)