/makeadmin Command! help = +1 REP
#1

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"
Reply
#2

post the error lines
Reply
#3

I have i have done // LINE 450 etc...
Reply
#4

check the color_red define

it must be like

pawn Код:
#define COLOR_RED       0xFF0000AA
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)