VIP and Admin chat doesn't work
#1

when i write in game, nuttin happns, and i dont see anythin :<

i got this:

Код:
public OnPlayerText(playerid, text[])
{
	if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
	  new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
		for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[playerid][Level] == 1)
		SendClientMessage(a, COLOR_GREEN, string);
	}
	if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
	  new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
		for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1)
		SendClientMessage(a, COLOR_GREY, string);
	}
Reply
#2

pawn Код:
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
      new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
        for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] == 1)
        SendClientMessage(a, COLOR_GREEN, string);
    }
    if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
      new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
        for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] >= 1 || PlayerInfo[a][VIP] == 1)
        SendClientMessage(a, COLOR_GREY, string);
    }
You should really look over your code before posting.
Reply
#3

when i use taht tihs happns:

when i write @LOL

My_Waffles_Bitch: @LOL
[VIP] My_Waffles_Bitch: LOL


and when i write #LOL nuttin happns :<
Reply
#4

Quote:
Originally Posted by hctiB_selffaW_yM
when i use taht tihs happns:

when i write @LOL

My_Waffles_Bitch: @LOL
[VIP] My_Waffles_Bitch: LOL


and when i write #LOL nuttin happns :<
You obviously have to disable onplayertext then.. return 0;
Reply
#5

ok, now tah VIP chat works perfect :> but i got probs with tah admin chat :<

what i got:

Код:
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] == 1)
  SendClientMessage(a, COLOR_GREEN, string);
  }
  if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] >= 1 || PlayerInfo[playerid][VIP] == 1)
  SendClientMessage(a, COLOR_GREY, string);
  return 0;
  }
Reply
#6

Quote:
Originally Posted by hctiB_selffaW_yM
ok, now tah VIP chat works perfect :> but i got probs with tah admin chat :<

what i got:

Код:
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] == 1)
  SendClientMessage(a, COLOR_GREEN, string);
  }
  if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] >= 1 || PlayerInfo[playerid][VIP] == 1)
  SendClientMessage(a, COLOR_GREY, string);
  return 0;
  }
Either your level isn't one, or # is an invalid symbol somehow. Try other symbols.

I think # is the symbol % get's turned into, may be why.
Reply
#7

i fixd it by myself :>

Код:
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
  MessageToAdmins(COLOR_GREEN, string);
	return 0;
	}
  if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] >= 1 || PlayerInfo[playerid][VIP] == 1)
  SendClientMessage(a, COLOR_GREY, string);
  return 0;
  }
now teh chats works perfecto :>
Reply
#8

Quote:
Originally Posted by hctiB_selffaW_yM
i fixd it by myself :>

Код:
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
  MessageToAdmins(COLOR_GREEN, string);
	return 0;
	}
  if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIP] == 1) {
  new string[128]; GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"[VIP] %s: %s",string,text[1]);
  for (new a = 0; a < MAX_PLAYERS; a++) if(IsPlayerConnected(a) && PlayerInfo[a][Level] >= 1 || PlayerInfo[playerid][VIP] == 1)
  SendClientMessage(a, COLOR_GREY, string);
  return 0;
  }
now teh chats works perfecto :>
You didn't fix it lol, you just created a function.
You won't improve your scripting skills unless you spend time.
Reply
#9

but it works :> and tahts tah point for now, im a bit nooby to script, but can still make mah own admin script!.. :>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)