Dual working cmd.
#1

hello, i dont know how to make dual working cmd.

i want make cmd for admins and for helpers, but i want when use helper this cmd, send message to all:

Код:
format(string, sizeof(string),"[SERVER]: "COL_WHITE"Helper %s is cleared chat.", sendername);
i dont want:

Код:
format(string, sizeof(string),"[SERVER]: "COL_WHITE"Admin %s is cleared chat.", sendername);
because ,she not admin. is helper.


SORRY FOR MY BAD ENGLISH
Код:
CMD:cc(playerid, params[])
{

    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");
	else
	{
	    new string[248], sendername[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    
		ClearChatboxToAll(playerid,100);
		
		format(string, sizeof(string),""COL_WHITE"Admin %s is cleared chat.", sendername);
		SendClientMessageToAll(COLOR_ORANGE,string);
		
		SendClientMessage(playerid, COLOR_RED, "[SERVER]: You are cleaned chat");
	}
	return 1;
}
Reply
#2

I guess pAdmin level 1 is helper, and above is administrators?
Then just use a switch to detect if they're level 1 or above.
pawn Код:
switch(PlayerInfo[playerid][pAdmin])
{
    case 1: // Level 1 (helper)
    default: // All other levels (administrator)
}
And SendClientMessageToAll accordingly.
Reply
#3

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
I guess pAdmin level 1 is helper, and above is administrators?
Then just use a switch to detect if they're level 1 or above.
pawn Код:
switch(PlayerInfo[playerid][pAdmin])
{
    case 1: // Level 1 (helper)
    default: // All other levels (administrator)
}
And SendClientMessageToAll accordingly.
No, Admin have pAdmin, helpers have pHelper
Reply
#4

Then use an if to detect if they have pHelper or pAdmin, and SendClientMessageToAll accordingly.
Example:
pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0) // Administrator
else if(PlayerInfo[playerid][pHelper] > 0) // Helper
Reply
#5

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Then use an if to detect if they have pHelper or pAdmin, and SendClientMessageToAll accordingly.
Example:
pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0) // Administrator
else if(PlayerInfo[playerid][pHelper] > 0) // Helper
i dont understound
Reply
#6

That code will check if his pAdmin level is higher than 0, if so he's an admin, so use SendClientMessageToAll with an admin tag.
The other code checks if his pHelper level is higher than 0, if so use SendClientMessageToAll with an helper tag.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)