03.02.2016, 09:43
Trying to create a /admins command but I need help fixing the errors.
Error is
The error at 26919 is
Warning at 26923 is
The error at 26924 is
The error at 26926 is
Please help? I will +1 Rep
PHP Code:
CMD:admins(playerid, params[])
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if(GetPlayerScore(playerid) < 50) return SendClientMessage(playerid, COLOR_RED, "You need 50 score to see online administrators");
new count = 0, string[828], AdmRank[128];
new ChangeColor;
SendClientMessage(playerid, COLOR_GREEN, " ");
SendClientMessage(playerid, COLOR_GREEN, "___________ |- Online Admins -| ___________");
SendClientMessage(playerid, COLOR_GREEN, " ");
if(IsPlayerConnected)
{
if (adlvl[playerid] >= 1)
{
if(adlvl[playerid] > 6)
{
AdmRank = "Server Owner/Developer";
ChangeColor = COL_LEVEL4;
}
else
{
switch(adlvl[playerid])
{
case 1: {
AdmRank = "Moderator";
ChangeColor = COL_LEVEL1;
}
case 2: {
AdmRank = "Senior Moderator";
ChangeColor = COL_LEVEL2;
}
case 3: {
AdmRank = "Administrator";
ChangeColor = COL_LEVEL3;
}
case 4: {
AdmRank = "Lead Administrator";
ChangeColor = COL_LEVEL4;
}
case 5: {
AdmRank = "Lead Administrator";
ChangeColor = COL_LEVEL4;
}
}
}
format(string, 128, "%s | %s", playername, AdmRank);
SendClientMessage(playerid, string, ChangeColor);
count ++;
}
}
}
if(count == 0)
SendClientMessage(playerid, ADMINSONLINE, "There are currently no administrators online.");
return 1;
}
Code:
E:\All Folders\Hobbies\Server Hosting\SA-MP\_PrP Gaming\gamemodes\RNTG.pwn(26919) : error 035: argument type mismatch (argument 1) E:\All Folders\Hobbies\Server Hosting\SA-MP\_PrP Gaming\gamemodes\RNTG.pwn(26923) : warning 209: function "cmd_admins" should return a value E:\All Folders\Hobbies\Server Hosting\SA-MP\_PrP Gaming\gamemodes\RNTG.pwn(26924) : error 010: invalid function or declaration E:\All Folders\Hobbies\Server Hosting\SA-MP\_PrP Gaming\gamemodes\RNTG.pwn(26926) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
PHP Code:
SendClientMessage(string, ChangeColor);
PHP Code:
}
PHP Code:
if(count == 0)
PHP Code:
return 1;