Argument type mismatch -
lramos15 - 30.05.2013
Код 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?
Re: Argument type mismatch -
Richie© - 30.05.2013
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;
}
Re: Argument type mismatch -
lramos15 - 30.05.2013
Not trying not to sound mean but that doesn't explain my problem.
Re: Argument type mismatch -
Richie© - 30.05.2013
I dont see whats wrong eigther, but you asked about setadmin cmd......
Which line is in the code is the error in?
Re: Argument type mismatch -
lramos15 - 30.05.2013
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.
Re : Argument type mismatch -
yusei - 30.05.2013
show us the Define (macro) of ''COL_RED''
Re: Argument type mismatch -
lramos15 - 30.05.2013
Here is the red define
Код HTML:
#define COL_RED "{F81414}"
AW: Argument type mismatch -
HurtLocker - 30.05.2013
#define COL_RED 0xF81414AA
and you are done.
Re: Argument type mismatch -
lramos15 - 30.05.2013
Thanks I have found out that the color codes for dialogs are different
Re: Argument type mismatch -
Guest123 - 30.05.2013
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;
}