01.09.2014, 19:41
(
Последний раз редактировалось LeroyII; 01.09.2014 в 21:35.
)
Hey guys.. Look at this code...
When i compile it here is what i get:
And when i type /admins in game it just shows NOTLOGGED
And when i do this:
I get no error or warning but command doesn't work.
Any idea what it is or how to fix it?
pawn Код:
CMD:admins(playerid, params[])
{
if(PlayerInfo[playerid][LoggedIn]) return SendClientMessage(playerid, COLOR_GREY, "NOTLOGGED");
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " ");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "----------| Online Admins |----------");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] > 0)
{
}
if(IsPlayerConnected(i))
{
new aname[48], atitle[48];
if(PlayerInfo[i][Level] == 7) { atitle = "Owner"; }
if(PlayerInfo[i][Level] == 6) { atitle = "Moderator"; }
if(PlayerInfo[i][Level] == 5) { atitle = "Lead Administrator"; }
if(PlayerInfo[i][Level] == 4) { atitle = "Senior Administrator"; }
if(PlayerInfo[i][Level] == 3) { atitle = "Administrator"; }
if(PlayerInfo[i][Level] == 2) { atitle = "Junior Administrator"; }
if(PlayerInfo[i][Level] == 1) { atitle = "Trial Administrator"; }
GetPlayerName(i, aname, sizeof(aname));
/* if(!AdminDuty[i])
{
format(string, sizeof(string), "[*] [%s] %s (Admin duty: No)", atitle, aname);
SendClientMessage(playerid, COLOR_LBLUE, string);
}
else
{
format(string, sizeof(string), "[*] [%s] %s (Admin duty: Yes)", atitle, aname);
SendClientMessage(playerid, COLOR_LBLUE, string);*/
}
continue;
}
}
}
Quote:
E:\Desktop\SA-MP\New folder\gamemodes\SATDMv9.pwn(14674) : warning 209: function "cmd_admins" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. |
And when i do this:
pawn Код:
CMD:admins(playerid, params[])
{
if(PlayerInfo[playerid][LoggedIn] == 0) //this line is changed
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " ");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "----------| Online Admins |----------");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] > 0)
{
}
if(IsPlayerConnected(i))
{
new aname[48], atitle[48];
if(PlayerInfo[i][Level] == 7) { atitle = "Owner"; }
if(PlayerInfo[i][Level] == 6) { atitle = "Moderator"; }
if(PlayerInfo[i][Level] == 5) { atitle = "Lead Administrator"; }
if(PlayerInfo[i][Level] == 4) { atitle = "Senior Administrator"; }
if(PlayerInfo[i][Level] == 3) { atitle = "Administrator"; }
if(PlayerInfo[i][Level] == 2) { atitle = "Junior Administrator"; }
if(PlayerInfo[i][Level] == 1) { atitle = "Trial Administrator"; }
GetPlayerName(i, aname, sizeof(aname));
/* if(!AdminDuty[i])
{
format(string, sizeof(string), "[*] [%s] %s (Admin duty: No)", atitle, aname);
SendClientMessage(playerid, COLOR_LBLUE, string);
}
else
{
format(string, sizeof(string), "[*] [%s] %s (Admin duty: Yes)", atitle, aname);
SendClientMessage(playerid, COLOR_LBLUE, string);*/
}
continue;
}
}
}
Any idea what it is or how to fix it?