I need help with this one -
Artix - 13.11.2011
Код:
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.
Re: I need help with this one -
Mr_Scripter - 13.11.2011
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
Re: I need help with this one -
Artix - 13.11.2011
it's not in that one
in face all commands working
but the /admins is not working
Re: I need help with this one -
sleepysnowflake - 13.11.2011
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.
Re: I need help with this one -
Mr_Scripter - 13.11.2011
Oh.. My bad lol
Re: I need help with this one -
Artix - 13.11.2011
umm can you help me fix it?
Re: I need help with this one -
CSSI - 13.11.2011
You need To Loop Through All Players to Check who's Admin , Use foreach
Re: I need help with this one -
GAMER_PS2 - 13.11.2011
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
Re: I need help with this one -
sleepysnowflake - 13.11.2011
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.
Re: I need help with this one -
Artix - 13.11.2011
still same
wont work