Argument type mismatch
#1

Код HTML:
CMD:adutyon(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COL_RED, "ERROR: You are not atleast Admin Level 1!"); //This will make Admin LVL 1 + Cmd. If you're not admin lvl 1, you will get the Message.
    SetPlayerHealth(playerid, 999999); //Setting player's max Health to UNLIMITED
    GivePlayerWeapon(playerid, 38, 999999); //Giving a Minigun to the player
   	return 1;
}
Then I get the error C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(331) : error 035: argument type mismatch (argument 2)
I don't see what is wrong also how would I go about making a set admin command?
Reply
#2

If you are using sscanf, you can simply do it like this;
pawn Код:
CMD:setadmin(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not admin!");
   
    new id, lvl, str[128];
    if(sscanf(params, "ud", id, lvl)) return SendClientMessage(playerid, -1, "Usage: /setadmin [Name/id] [Level]");
   
    PlayerInfo[id][pAdmin] = lvl; // Set the admin lvl of the chosen player
    format(str, sizeof(str), "You have set %s's admin LVL to %d", pName(id), lvl); // replace pName with whatever function you use for getting name
    SendClientMessage(playerid, -1, str);
    return 1;
}
Reply
#3

Not trying not to sound mean but that doesn't explain my problem.
Reply
#4

I dont see whats wrong eigther, but you asked about setadmin cmd......
Which line is in the code is the error in?
Reply
#5

With the set admin command I have dont have a name variable how could I make one? This is the line with the error
Код HTML:
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COL_RED, "ERROR: You are not atleast Admin Level 1!"); //This will make Admin LVL 1 + Cmd. If you're not admin lvl 1, you will get the Message.
Reply
#6

show us the Define (macro) of ''COL_RED''
Reply
#7

Here is the red define
Код HTML:
#define COL_RED "{F81414}"
Reply
#8

#define COL_RED 0xF81414AA

and you are done.
Reply
#9

Thanks I have found out that the color codes for dialogs are different
Reply
#10

use this

pawn Код:
#define COL_RED 0xFF0000FF
or you can use my code

pawn Код:
CMD:adutyon(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COL_RED, "ERROR: You are not atleast Admin Level 1!"); //This will make Admin LVL 1 + Cmd. If you're not admin lvl 1, you will get the Message.
    SetPlayerHealth(playerid, 999999); //Setting player's max Health to UNLIMITED
    GivePlayerWeapon(playerid, 38, 999999); //Giving a Minigun to the player
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)