How to make Message globally?
#1

How to make this chat Globally? I mean all players will see it but only Admins can do it

Code:
CMD:razer(playerid, params[])
{
	SendClientMessageEx(playerid,0xFFFFFFFF,"====================================================================================================");
	SendClientMessageEx(playerid, COLOR_GREEN, "Razer Gaming Roleplay : Owner");
 	SendClientMessageEx(playerid, COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
 	SendClientMessageEx(playerid, COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageEx(playerid, COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
 	SendClientMessageEx(playerid,0xFFFFFFFF,"====================================================================================================");
 	return 1;

}
Reply
#2

pawn Code:
CMD:razer(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 1)//replace with your admin variable.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(playerid, COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
Reply
#3

Quote:
Originally Posted by EiresJason
View Post
pawn Code:
CMD:razer(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 1)//replace with your admin variable.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(playerid, COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
What do you mean by Admin Variable, and it will be send globally? I have RP Server btw.
Reply
#4

Show us a command that only admins can do at the moment and we'll explain it to you what is meant by an admin variable.
Reply
#5

Yeah, it will send globally.

By 'admin variable', I mean whatever you assign the admin level to for a player.

Like:
pawn Code:
enum pInfo
{
    Age,
    Skin,
    Score,
    AdminLevel //this would be your 'admin variable'.
};
new PlayerInfo[MAX_PLAYERS][pInfo];

//this code will only allow RCON administrators to send the message.
CMD:razer(playerid, params[])
{
     if(IsPlayerAdmin(playerid))//replace with your admin variable.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(playerid, COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
Also, what Danish said
Reply
#6

This?


pawn Code:
CMD:ah(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
        SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
        SendClientMessageEx(playerid, COLOR_GRAD1, "*** SERVER MODERATOR *** /mjail /kick /c /togadvisor /togjoin");
    }
    if (PlayerInfo[playerid][pAdmin] >= 2)
    {
        SendClientMessageEx(playerid, COLOR_WHITE,"*** JUNIOR ADMIN *** /kick /ban /jail /bigears /freeze /unfreeze /spec /aslap /warn /cnn ");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** JUNIOR ADMIN *** /gethere /goto /hospital /gotoloc /requestevent /clearchat /cc /watch");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** JUNIOR ADMIN *** /adminduty /gotoplayerscar /jetpack /god /check /ipcheck /ip /hlmute");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** JUNIOR ADMIN *** /nrn /listguns /setvw /setint /vehname /watch");
    }
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
        SendClientMessageEx(playerid, COLOR_NG,"*** GENERAL ADMIN *** /noooc /nonewbie /prison /fine /pfine /takeadminweapons /sendtols /prisonaccount /gotocar /entercar");
        SendClientMessageEx(playerid, COLOR_NG,"*** GENERAL ADMIN *** /mole /setskin /countdown /release /force(death/hospital) /rto(reset) /jailaccount /(o)clearflag /mark ");
        SendClientMessageEx(playerid, COLOR_NG,"*** GENERAL ADMIN *** /gotoco /n(un)mute /ad(un)mute /leaders /dm /wepreset /ocheck /owarn /ofine /okills");
        SendClientMessageEx(playerid, COLOR_NG,"*** GENERAL ADMIN *** /gr /cr /oocpower  /revive /sendtoid /refund /getcar /reloadpvehicles");
    }
    if (PlayerInfo[playerid][pAdmin] >= 4)
    {
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /edit /asellhouse /setchamp /setarmorall /fixvehall /givenos /blowup /setname /startlotto /savechars");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /setstat /veh /fixveh /sethp /setarmor /givegun /givemoney /setmoney /setstat /setfightstyle");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /fcreate /fdelete /adivorce /destroycar /destroycars /eventhelp /contracts /sprison /sjail /listfacpay");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /facban /faccsfban /unban /unbanip /deletehit /clearall /setinsurance /givelicense /adestroyplant");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /switchfac /switchfam /facpay /cmotd /setcapping /banaccount /hedit /dd(edit/next/name/pass");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /createpvehicle /destroypvehicle /creategvehicle /vipparty /vto /vtoreset /forceskin /admingatepw /gotogate");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /hnext /dmpnext /g(status/near/next/edit) /(goto/goin)door /(goto/goin)house /(create/delete/goto)point");
        SendClientMessageEx(playerid, COLOR_WHITE,"*** SENIOR ADMIN *** /hedit /dd(edit/next/name/pass) /dmpedit /dmpnear /gotomapicon /gangwarn /gangunban /setcapping");
    }
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
        SendClientMessageEx(playerid, COLOR_LIGHTRED,"*** Elite Admin *** /weather /weatherall /makehelper /tod /dedit /pedit /facunban /faccsfunban /giftall");
        SendClientMessageEx(playerid, COLOR_LIGHTRED,"*** Elite Admin *** /permaban /setcolor /payday /clearallreports /eventreset /givetoken /banip /banaccount /gifts");
        SendClientMessageEx(playerid, COLOR_LIGHTRED,"*** Elite Admin *** /createdealership /destroydealership /createcdveh /destroycdveh /famedit /setvip /vmute /vsuspend");
    }
    if (PlayerInfo[playerid][pAdmin] >= 1338)
    {
        SendClientMessageEx(playerid, COLOR_LIGHTRED,"*** LEAD ADMIN *** /suspend /osuspend /rmute /makeadmin /makeleader /makehelper /makemoderator");
        SendClientMessageEx(playerid, COLOR_LIGHTRED,"*** LEAD ADMIN *** /random /vrandom /giftreset /vipgifts");
    }
    if (PlayerInfo[playerid][pAdmin] >= 1339)
    {
        SendClientMessageEx(playerid, COLOR_GREEN,"*** Developer *** ");
    }
    if (PlayerInfo[playerid][pAdmin] >= 99995)
    {
        SendClientMessageEx(playerid, COLOR_LIME,"*** Server Manager ***   ");
    }
    if (PlayerInfo[playerid][pAdmin] >= 999998)
    {
        SendClientMessageEx(playerid, COLOR_LIME,"*** Co - Executive Admin***  ");
    }
    if (PlayerInfo[playerid][pAdmin] >= 999999)
    {
        SendClientMessageEx(playerid, COLOR_LIME,"*** Executive Admin*** [Administration Commands: /togreports]*** Executive Admin*** ");
    }
    if (PlayerInfo[playerid][pBanAppealer] == 1 || PlayerInfo[playerid][pShopTech] == 1 || PlayerInfo[playerid][pUndercover] == 1 || PlayerInfo[playerid][pFactionModerator] == 1 || PlayerInfo[playerid][pBanAppealer] == 1 || PlayerInfo[playerid][pShopTech] == 1 || PlayerInfo[playerid][pUndercover] == 1 || PlayerInfo[playerid][pGangModerator] == 1)
    {
        new string2[256];
        format(string2, sizeof(string2), "*** SPECIAL ***");
        if (PlayerInfo[playerid][pBanAppealer] == 1) format(string2, sizeof(string2), "%s /unbanip /unban", string2);
        if (PlayerInfo[playerid][pShopTech] == 1) format(string2, sizeof(string2), "%s /orders /shopblock /setvip /shopcar /shopcardel /shophouse /shoptokens /shoplaser /shopvest /gedit /gnear /gstatus /gnext /hnext /gotogate", string2);
        if (PlayerInfo[playerid][pUndercover] == 1) format(string2, sizeof(string2), "%s /setmystat /setmyname /setmyhp /setmyarmour /sprison /sjail /sdm /swarn", string2);
        if (PlayerInfo[playerid][pFactionModerator] == 1) format(string2, sizeof(string2), "%s /listfacpay /facpay /switchfac /faccsfban /facban /fackick /leaders", string2);
        if (PlayerInfo[playerid][pGangModerator] == 1) format(string2, sizeof(string2), "%s /switchfam /famedit /creategvehicle /destroygvehicle /gangwarn /gangunban /fcreate /fdelete /twmenu", string2);

        if(strlen(string2) >= 128)
        {
            new firstline[128], secondline[128];
            strmid(firstline, string2, 0, 128);
            strmid(secondline, string2, 128, 256);
            SendClientMessageEx(playerid, COLOR_GRAD5, firstline);
            SendClientMessageEx(playerid, COLOR_GRAD5, secondline);
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD5,string2);
        }
    }
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
        SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
    }
    return 1;
}
Reply
#7

Oh, the first code I sent will work

pawn Code:
CMD:razer(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 1)//replace '1' with the level of the admin you only want to be allowed to this command.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
Reply
#8

Quote:
Originally Posted by EiresJason
View Post
Oh, the first code I sent will work

pawn Code:
CMD:razer(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 1)//replace '1' with the level of the admin you only want to be allowed to this command.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(playerid, COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
USE THIS Script. This will work.
Reply
#9

Got this error.

pawn Code:
C:\Users\user\Desktop\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(38620) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

Whoops lol. Forgot to remove one playerid xD. I'm gonna use the excuse I have a bad flu atm

pawn Code:
CMD:razer(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 1)//replace '1' with the level of the admin you only want to be allowed to this command.
     {
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
    SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
    SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
    SendClientMessageToAll(COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
    SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
      }    
return 1;

}
Reply
#11

Remove playerid from the sixth SendClientMessage.
Edit: Lol, late
Reply
#12

pawn Код:
CMD:razer(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)//replace '1' with the level of the admin you only want to be allowed to this command.  {SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    {
        SendClientMessageToAll(COLOR_GREEN, "Razer Gaming Roleplay : Owner");
        SendClientMessageToAll(COLOR_WHITE, "If you're bored play PAINTBALL or Roleplay with others");
        SendClientMessageToAll(COLOR_WHITE, "If you have suggestions talk to Razer IG or Post it on forums");
        SendClientMessageToAll(COLOR_YELLOW, "Don't forget to visit the forums everytime for updates!");
        SendClientMessageToAll(0xFFFFFFFF,"====================================================================================================");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)