Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerText(playerid, text[])
- {
- new string[126];
- if(text[0] == '!')
- {
- new Name[24], Msg[1000];
- GetPlayerName(playerid, Name, sizeof(Name));
- for (new i; i < MAX_PLAYERS; i++)
- {
- if (APlayerData[i][LoggedIn] == true)
- {
- if(APlayerData[playerid][PlayerLevel] >= 4)
- {
- if (APlayerData[i][PlayerLevel] >= 4)
- {
- format(Msg, 1000, "{EEC591}* {00FFFF}%s (id: %i): {EEC591}%s", Name, playerid, text[1]);
- SendClientMessage(i, 0xFFFFFFFF, Msg);
- }
- }
- }
- }
- return 0;
- }
- if(text[0] == ';')
- {
- new chat[9000];
- format(chat, sizeof(chat), "%s",text);
- new output[9000], pNameX[MAX_PLAYER_NAME],outadm[9000],rawstring[9000];
- GetPlayerName(playerid, pNameX, sizeof(pNameX));
- format(output, sizeof(output), "{228B22}× %s [id: {FFFFFF}%i{228B22}] diz: {FFFFFF}%s", pNameX, playerid, text[1]);
- format(rawstring, sizeof(rawstring), "%s",string);
- new Float:PosicaoX, Float:PosicaoY, Float:PosicaoZ;
- GetPlayerPos(playerid, PosicaoX, PosicaoY, PosicaoZ);
- format(outadm, sizeof(outadm), "{228B22}× {228B22}| {FFFFFF}ChatProximo {228B22}| {228B22}%s [id: {FFFFFF}%i{228B22}] diz: {FFFFFF}%s", pNameX,playerid,text[1]);
- foreach(Player, i){if(IsPlayerConnected(i)){
- if(APlayerData[i][PlayerLevel] >= 4){
- if(!IsPlayerInRangeOfPoint(i, 20.0, PosicaoX, PosicaoY, PosicaoZ)){
- SendClientMessage(i, -1, outadm);}}}}
- foreach(Player, i){if(IsPlayerConnected(i)){
- if(IsPlayerInRangeOfPoint(i, 20.0, PosicaoX, PosicaoY, PosicaoZ)){
- SendClientMessage(i, -1, output);
- PlayerPlaySound(i,1057,0.0,0.0,0.0);}}}
- SetPlayerChatBubble(playerid, rawstring, 0x00FFFFFF, 20.0, 10000);
- return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment