/makeadmin Command! help = +1 REP - 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: /makeadmin Command! help = +1 REP (
/showthread.php?tid=537266)
/makeadmin Command! help = +1 REP -
MrCallum - 14.09.2014
I have a command and apparently this is not working!
Код:
CMD:makeadmin(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] == 4)
{
new targetid,level,string[128];
if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid,COLOR_GREY,"Syntax: /makeadmin [playerid] [Level]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online"); // LINE 442
if(level < 0 || level > 5) return SendClientMessage(playerid,COLOR_RED,"Admin levels are only between 1-5"); // LINE 443
PlayerInfo[targetid][pAdmin] = level;
format(string, sizeof(string), "You have set %s(ID:%d) to Level %s(%d)",PlayerName(targetid),targetid,AdminLevelName(targetid),level);
SendClientMessage(playerid, 0xAFAFAFAA, string);
format(string, sizeof(string), "%s(ID:%d) has set your level to %s(%d)",PlayerName(playerid),playerid,AdminLevelName(targetid),level);
SendClientMessage(playerid, 0xAFAFAFAA, string);
}
else SendClientMessage(playerid,COLOR_RED,"You are not an admin."); // LINE 450
return 1;
}
Errors:
Код:
C:\Users\Callum.Acer\Desktop\Gamemode.pwn(442) : error 035: argument type mismatch (argument 2)
C:\Users\Callum.Acer\Desktop\Gamemode.pwn(443) : error 035: argument type mismatch (argument 2)
C:\Users\Callum.Acer\Desktop\Gamemode.pwn(450) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Код:
Defines/Includes:
//Includes//
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>
//Defines//
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_RULES 3
#define PATH "/User/%s.ini"
Re: /makeadmin Command! help = +1 REP -
IceBilizard - 14.09.2014
post the error lines
Re: /makeadmin Command! help = +1 REP -
MrCallum - 14.09.2014
I have i have done // LINE 450 etc...
Re: /makeadmin Command! help = +1 REP -
IceBilizard - 14.09.2014
check the color_red define
it must be like
pawn Код:
#define COLOR_RED 0xFF0000AA