15.03.2014, 16:15
(
Последний раз редактировалось ShinichiKudou; 15.03.2014 в 19:43.
)
/g chat global chat command
/toggc global chat toggle
I have this cmd but i want the message to show up only if the toggle was on
can you please help me
pawn Код:
CMD:g(playerid,params[])
{
if(toggc[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "======== Use /toggc First! ========");
else if(toggc[playerid] == 1)
{
new rank[50],name[50],text[200],msg[250];
if(sscanf(params,"s[200]",text)) return SendClientMessage(playerid,-1,"USAGE: /g [text]");
GetPlayerName(playerid,name,sizeof(name));
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
format(rank,sizeof(rank),"Moderator");
}
else if(PlayerInfo[playerid][pAdmin] == 2)
{
format(rank,sizeof(rank),"Junior Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 3)
{
format(rank,sizeof(rank),"General Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 4)
{
format(rank,sizeof(rank),"Senior Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 1337)
{
format(rank,sizeof(rank),"Head Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 1338)
{
format(rank,sizeof(rank),"Lead Head Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 999997)
{
format(rank,sizeof(rank),"Executive Admin");
}
else if(PlayerInfo[playerid][pAdmin] == 999998)
{
format(rank,sizeof(rank),"Community Co-Director");
}
else if(PlayerInfo[playerid][pAdmin] == 999999)
{
format(rank,sizeof(rank),"Community Director");
}
}
else if(PlayerInfo[playerid][pHelper] > 0)
{
if(PlayerInfo[playerid][pHelper] == 1)
{
format(rank,sizeof(rank),"Helper");
}
else if(PlayerInfo[playerid][pHelper] == 2)
{
format(rank,sizeof(rank),"Community Advisor");
}
else if(PlayerInfo[playerid][pHelper] == 3)
{
format(rank,sizeof(rank),"Senior Advisor");
}
else if(PlayerInfo[playerid][pHelper] == 4)
{
format(rank,sizeof(rank),"Chief Advisor");
}
}
else if(PlayerInfo[playerid][pDonateRank] > 0)
{
if(PlayerInfo[playerid][pDonateRank] == 1)
{
format(rank,sizeof(rank),"Bronze VIP");
}
else if(PlayerInfo[playerid][pDonateRank] == 2)
{
format(rank,sizeof(rank),"Silver VIP");
}
else if(PlayerInfo[playerid][pDonateRank] == 3)
{
format(rank,sizeof(rank),"Gold VIP");
}
else if(PlayerInfo[playerid][pDonateRank] == 4)
{
format(rank,sizeof(rank),"Platinum VIP");
}
else if(PlayerInfo[playerid][pDonateRank] == 5)
{
format(rank,sizeof(rank),"VIP Moderator");
}
}
else if(PlayerInfo[playerid][pAdmin] < 0 || PlayerInfo[playerid][pHelper] < 0 || PlayerInfo[playerid][pDonateRank] < 0)
{
format(rank,sizeof(rank),"Player");
}
format(msg,sizeof(msg),"(( %s %s: %s ))",rank,name,text);
for(new i=0;i<=MAX_PLAYERS;i++)
{
SendClientMessage(i,COLOR_ORANGE,msg);
}
}
return 1;
}
pawn Код:
CMD:toggc(playerid,params[])
{
if(toggc[playerid] == 0)
{
SendClientMessage(playerid,-1,"You have enabled global chat!");
toggc[playerid] = 1;
}
else if(toggc[playerid] == 1)
{
SendClientMessage(playerid,-1,"You have disabled global chat!");
toggc[playerid] = 0;
}
return 1;
}
can you please help me