SA-MP Forums Archive
ingame languages - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ingame languages (/showthread.php?tid=112218)



ingame languages - armyoftwo - 06.12.2009

is it possible to make this:

Aliens talk with humans. But other aliens can see what alien is saying right

Alien: Hello human
but human will see:
Alien: ALfmc sdlkug



Re: ingame languages - [NYRP]Mike. - 06.12.2009

pawn Код:
#include <a_samp>

#define COLOR_WHITE 0xFFFFFFAA

new IsHuman[MAX_PLAYERS];
new IsAlien[MAX_PLAYERS];

new string[128];

public OnPlayerText(playerid, text[])
{
  new sendername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsHuman[playerid] == 1)
    {
    format(string, sizeof(string), "%s says: %s",sendername,text);
        SendClientMessage(playerid, COLOR_WHITE, string);
        print(text);
    }
    else if(IsHuman[playerid] != 1)
    {
      format(string, sizeof(string), "%s says: -Unknown Language-",sendername);
        SendClientMessage(playerid, COLOR_WHITE, string);
        print(text);
    }
    if(IsAlien[playerid] == 1)
    {
    format(string, sizeof(string), "%s says: %s",sendername,text);
        SendClientMessage(playerid, COLOR_WHITE, string);
        print(text);
    }
    else if(IsAlien[playerid] != 1)
    {
      format(string, sizeof(string), "%s says: -Unknown Language-",sendername);
        SendClientMessage(playerid, COLOR_WHITE, string);
        print(text);
    }
    return 1;
}
change IsHuman / IsAlien to yours e.g IsPlayerHuman or something and if a human talks to an alien it will say -Unknown Language- same to Aliens and humans.