Problem with DCMD Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with DCMD Command (
/showthread.php?tid=287578)
Problem with DCMD Command -
SanAndreasVille - 03.10.2011
Hello i have a problem with a script that show me admins of the server its work but have a player ID 2 is that in the admin list he isnt a admin what is wrong?
Код:
dcmd_admins(playerid,params[])
{
new sendername[MAX_PLAYER_NAME];
#pragma unused params
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_RED, "Server Administrator");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Admin[i][AdminLevel] > 1336)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string1, sizeof(string1), "Administrator: %s ", sendername);
SendClientMessage(playerid, COLOR_RED, string1);
}
}
}
}
return 1;
}
Re: Problem with DCMD Command -
CyNiC - 03.10.2011
You reseted the Admin var on the OnPlayerDisconnect/Connect?
AW: Problem with DCMD Command -
SanAndreasVille - 03.10.2011
this is only in my script
Код:
public OnPlayerDisconnect(playerid, reason)
{
Admin[playerid][Loggedin] = 0;
return 1;
and It will be displayed following user ID as admin ID 2, 4,6,8,10 every two steps
AW: Problem with DCMD Command -
SanAndreasVille - 04.10.2011
Now i have this in my script
Код:
dcmd_admins(playerid,params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW, "Administrators at work");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Admin[i][AdminLevel] > 1336)
{
new sendername[MAX_PLAYER_NAME], strink[128];
GetPlayerName(i, sendername, sizeof(sendername));
format(strink, sizeof strink, " Administrator: %s", sendername);
SendClientMessage(playerid, COLOR_RED, strink);
}
}
}
}
return 1;
}
now it goes but is always displayed as ID 0 as admin