06.01.2015, 10:44
(
Последний раз редактировалось MrViolence101; 06.01.2015 в 10:46.
Причина: title change
)
Hey guys
Im having some trouble with my coding, i have two commands the one is basically for chatting in OOC and i have another command available for players (togwap) . If they use togwap it must disable ooc for them so that they dont see the messages. I have been struggling to make that happen. I hope you guys can help me, i will post the coding![Smiley](images/smilies/smile.png)
I used a for loop :P
the second coding i will post is my /toggle command for players .
Im having some trouble with my coding, i have two commands the one is basically for chatting in OOC and i have another command available for players (togwap) . If they use togwap it must disable ooc for them so that they dont see the messages. I have been struggling to make that happen. I hope you guys can help me, i will post the coding
![Smiley](images/smilies/smile.png)
pawn Код:
CMD:g(playerid, params[])
{
new msg[128], string[128];
new string2[128];
if (sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, RED, "USAGE : {FFFFFF}/g [MESSAGE]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && togwap[i] == 1)
{
if ((!PlayerInfo[i][pAdmin]) && (!PlayerInfo[i][pDonator]))
{
format(string, sizeof(string), "(( Player[level %d] %s : %s ))", PlayerInfo[i][pLevel], GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string);
}
if ((PlayerInfo[i][pAdmin]) && (PlayerInfo[i][pDonator]))
{
if (PlayerInfo[i][pAdmin] == 6)
{
format(string, sizeof(string), "(( Server Owner %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string);
}
}
if ((PlayerInfo[i][pAdmin]) && (!PlayerInfo[i][pDonator]))
{
if (PlayerInfo[i][pAdmin] == 6)
{
format(string, sizeof(string), "(( Server Owner %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string);
}
}
if ((PlayerInfo[i][pDonator]) && (!PlayerInfo[i][pAdmin]))
{
if (PlayerInfo[i][pDonator] == 3)
{
format(string2, sizeof(string2), "(( Bronze Donator %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string2);
}
if (PlayerInfo[i][pDonator] == 2)
{
format(string2, sizeof(string2), "(( Silver Donator %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string2);
}
if (PlayerInfo[i][pDonator] == 3)
{
format(string2, sizeof(string2), "(( Chrystal Donator %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string2);
}
if (PlayerInfo[i][pDonator] == 4)
{
format(string2, sizeof(string2), "(( Diamond Donator %s : %s ))", GetName(i), msg);
SendClientMessage(i, COLOR_OOC, string2);
}
}
}
}
return 1;
}
the second coding i will post is my /toggle command for players .
pawn Код:
CMD:togwap(playerid, params[])
{
if (togwap[playerid] == 1)
{
SendClientMessage(playerid, RED, "You have just disabled global chat for you!");
}
else if (togwap[playerid] == 0)
{
SendClientMessage(playerid, GREEN, "You have just enable global chat for you!");
}
return 1;
}