I need help with this one
#1

Код:
CMD:admins(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(PVar[playerid][pAdmin] >= 1)
	    {
	    	new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
       		if(PVar[playerid][pAdmin] == 4) { admtext = "Admin Level 4"; }
			else if(PVar[playerid][pAdmin] == 3) 	{ admtext = "Admin Level 3"; }
			else if(PVar[playerid][pAdmin] == 2)	{ admtext = "Admin Level 2"; }
			else if(PVar[playerid][pAdmin] == 1) 	{ admtext = "Admin Level 1"; }
			else { admtext = "Admin Level 1"; }
    		GetPlayerName(playerid, sendername, sizeof(sendername));
			sendername[strfind(sendername,"_")] = ' ';
			format(string, 128, "%s: %s ", admtext, sendername);
			SendClientMessage(playerid, random(0xFFFFFFFF), string);
			return 1;
  		}
	}
	return SendClientMessage(playerid, SERVER, "[iBot]:"#CWHITE" No Online Administrators ");
}
it cant detect and when i use the command

it says " SERVER:Unknown Command.
Reply
#2

you know that your command should be in last and not in any Callbacks like
pawn Код:
public OnPlayerCommandText(playerid,blabla); //not in any of these callbacks but in last
Reply
#3

it's not in that one

in face all commands working
but the /admins is not working
Reply
#4

They are 'callback ' and not 'cellback' whatever that means.

Anyways, it should be between 2 public funcitons.

Also, for your command to work, you need to loop through all players and see if any of them is an admin.
Reply
#5

Oh.. My bad lol
Reply
#6

umm can you help me fix it?
Reply
#7

You need To Loop Through All Players to Check who's Admin , Use foreach
Reply
#8

Mr_Scripter you are a failed one ZCMD dont support OnPlayerCommandText your answer is wrong well maybe right?

i can help you out here is the code
fix edition

pawn Код:
CMD:admins(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(PVar[playerid][pAdmin] >= 1)
        {
            new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
            if(PVar[playerid][pAdmin] == 4) { admtext = "Admin Level 4"; }
            else if(PVar[playerid][pAdmin] == 3)    { admtext = "Admin Level 3"; }
            else if(PVar[playerid][pAdmin] == 2)    { admtext = "Admin Level 2"; }
            else if(PVar[playerid][pAdmin] == 1)    { admtext = "Admin Level 1"; }
            else { admtext = "Admin Level 1"; }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            sendername[strfind(sendername,"_")] = ' ';
            format(string, 128, "%s: %s ", admtext, sendername);
            SendClientMessage(playerid, random(0xFFFFFFFF), string);
            return 1;
        }
    }
    else return SendClientMessage(playerid, SERVER, "[iBot]:"#CWHITE" No Online Administrators ");
        return 1;
}

public OnPlayerCommandPerformed(playerid,cmdtext[],success) //already include in ZCMD
{
    if(!success) SendClientMessage(playerid,COLOR_RED, "Command not found!, use /cmds for list of commands");
    return 1;
}
Not tested but give it try
Reply
#9

Quote:
Originally Posted by Mr_Scripter
Посмотреть сообщение
Oh.. My bad lol
You know how that would sound in real life ? You know what 'lol' means ? Let me show you:

Oh ... My bad <HAHAHHAMWAWMUWADHHAHAHHAHWUWUAUWAWMAAMAMWMaMWMAWW HMHAMHAMHAH>.

Yeah. Laughing like a mad man.
Reply
#10

still same
wont work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)