#define LAN_SERBIAN 1
#define LAN_ENGLISH 2
//...
new iLanguage[ MAX_PLAYERS char ];
//...
public OnPlayerConnect( playerid )
{
// Set the player's language somewhere here.
if( iLanguage{ playerid } == LAN_SERBIAN )
{
SendClientMessage( playerid, 0xFFFFFF, "Something serbian here." );
}
else
{
SendClientMessage( playerid, 0xFFFFFF, "Something english here." );
}
return true;
}
// Another method
stock SendLanMessage( playerid, color, const serbianMsg[ ], const englishMsg[ ] )
{
if( iLanguage{ playerid } == LAN_SERBIAN )
{
SendClientMessage( playerid, color, serbianMsg );
}
else
{
SendClientMessage( playerid, color, englishMsg );
}
return true;
}
//to use...
SendLanMessage( playerid, 0xFFFFFF, "serbian", "english" );
#include <a_samp>
#define L_ENGLISH (0)
#define L_SERBIAN (1)
#define LANG_DIALOG (500)
new bool:SelectedLang[MAX_PLAYERS];
new P_Language[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
if(!SelectedLang[ playerid ])
return 0;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
SelectedLang[ playerid ] = false;
P_Language[ playerid ] = L_ENGLISH;
ShowPlayerDialog(playerid, LANG_DIALOG, DIALOG_STYLE_LIST, "Languages", "English \nSerbian", "Accept", "Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case LANG_DIALOG:
{
if(response)
{
switch(listitem)
{
case 0://english
{
SelectedLang[ playerid ] = true;
}
case 1://serbian
{
SelectedLang[ playerid ] = true;
P_Language[ playerid ] = L_SERBIAN;
}
}
}
else
{
SelectedLang[ playerid ] = true;
}
}
}
return 1;
}
COMMAND:me(playerid, params[])
{
//blah blah
return 1;
}
COMMAND:mehe(playerid, params[])
{
return cmd_me(playerid, params);
}
if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,0); SendClientMessage(playerid, You suck); return 1; } |
if (strcmp("/kill", cmdtext, true, 10) == 0 || strcmp("/killinanotherlanguage", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,0);
SendClientMessage(playerid, You suck);
return 1;
}