admin chat
#1

Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '~' && PlayerInfo[playerid][gAdmin] > 0 || PlayerInfo[playerid][gVip] > 0){ // Jei pirmas simbolis yra ~, ir ar юaidлjas yra VIP, Admin.
new string[128]; GetPlayerName(playerid,string,sizeof(string)); // String, bei vardo gavimas
format(string,sizeof(string),"[Administracijos pokalbiai] %s sako: %s",string,text[1]); SiustiZinuteA(ZALIA,string); // Formatuojam, siunиiam юinutж
return 1; // Uюdarom
} // Uюdarom
.................... another script
and when i type anything ( NOT CMD ) its send message to admins.

(

Код:
if(text[0] == '~' && PlayerInfo[playerid][gAdmin] > 0 || PlayerInfo[playerid][gVip] > 0){ // Jei pirmas simbolis yra ~, ir ar юaidлjas yra VIP, Admin.
)
Reply
#2

Because or checking if the player is an admin AND the first character is ~, OR the first character is ANYTHING and the player is a VIP.
pawn Код:
if(text[0] == '~' && (PlayerInfo[playerid][gAdmin] > 0 || PlayerInfo[playerid][gVip] > 0))
Should do the job.
Reply
#3

Ok, its working.. But now, when i type

~ ss
its send message to admins, and "ss" to all
Reply
#4

Change return 1 to return 0.
Reply
#5

ok thx u.. maybe can u help me with team chat?.. when i type ! text its send message to all: *Nickname*.. im tryied to up string number, but nothing. ;/
Quote:

if(text[0] == '!') // Patikrinam, ar pradinis simbolis yra !
{
new string[150]; //String
GetPlayerName(playerid, string, sizeof(string)); // Vardo gavimas

PlayerLoop(i) // Ciklas
{ // Atidarom
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string); // Юinutл
} // Uюdarom
return 0; // Uюdarom
} // Uюdarom

Reply
#6

pawn Код:
if(text[0] == '!')
{
   new string[128+MAX_PLAYER_NAME+5];
   new name[24]; GetPlayerName(playerid,name,sizeof(name));
   format(string,sizeof(string),"*%s* : %s",name,text[1]);
   PlayerLoop(i)
   {
       if(IsPlayerConnected(i) &&(gTeam[i] == gTeam[playerid])) return SendClientMessage(i,GetPlayerColor(playerid),string);
   }
   return 0;
}
Reply
#7

Oh, thanks you! Just problem again. When i type ! sd its send message to all, and message to team, but there are no return 1; ;/
Reply
#8

pawn Код:
if(text[0] == '!')
{
   new string[128+MAX_PLAYER_NAME+5];
   new name[24]; GetPlayerName(playerid,name,sizeof(name));
   format(string,sizeof(string),"*%s* : %s",name,text[1]);
   PlayerLoop(i)
   {
       if(IsPlayerConnected(i) &&(gTeam[i] == gTeam[playerid]))
       {
           SendClientMessage(i,GetPlayerColor(playerid),string);
           return 0;
       }
   }
   return 0;
}
Reply
#9

Thanks you so much!
Reply
#10

sorry for db, but im didnt want to create another topic..

Quote:

COMMAND:masina(playerid, params[])
{
#pragma unused params
if(PlayerInfo[playerid][gAdmin] < 1 || PlayerInfo[playerid][gVip] < 1 || PlayerInfo[playerid][gDonator] < 1)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Administratoriams, VIP, Donatoriams!", "Gerai", "Uюdaryti");
return 1;
}
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Maрinш pasirinkimas", "Comet\nPCJ - 600\nCheetah\nUranus\nJester", "Rinktis", "Atрaukti");
return 1;
}

im admin, and when i type /masina, its say, that this cmds only for donators, admins, vip.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)