SA-MP Forums Archive
VIP and Admin chat doesn't work - 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: VIP and Admin chat doesn't work (/showthread.php?tid=66062)



VIP and Admin chat doesn't work - My_Waffles_Bitch_L0L - 19.02.2009

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);
	}



Re: VIP and Admin chat doesn't work - Norn - 19.02.2009

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.


Re: VIP and Admin chat doesn't work - My_Waffles_Bitch_L0L - 19.02.2009

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 :<


Re: VIP and Admin chat doesn't work - Norn - 19.02.2009

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;


Re: VIP and Admin chat doesn't work - My_Waffles_Bitch_L0L - 19.02.2009

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;
  }



Re: VIP and Admin chat doesn't work - Norn - 19.02.2009

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.


Re: VIP and Admin chat doesn't work - My_Waffles_Bitch_L0L - 19.02.2009

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 :>


Re: VIP and Admin chat doesn't work - Norn - 19.02.2009

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.


Re: VIP and Admin chat doesn't work - My_Waffles_Bitch_L0L - 19.02.2009

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