[HELP] Argument Type Mismatch
#1

PHP код:
new id;
// this line v
if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /acceptrelease [player]"); 
PHP код:
./includes/updates/prison_system.pwn(1858) : error 035: argument type mismatch (argument 1) 
pls halp
+1
Reply
#2

show
SendClientMessageEx
and
definition COLOR_GREY
Reply
#3

Can you show the whole command?
Reply
#4

Show us the definition of SendClientMessageEx. Other than that I don't see anything.
Reply
#5

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
show
SendClientMessageEx
and
definition COLOR_GREY
Those are not the issue as I've successful used them in other commands.

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Can you show the whole command?
Sure
PHP код:
command(acceptrelease, playerid, params)
{
    if(!
IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
    new 
id;
    
    if(
sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /acceptrelease [player]");
    
    if(
strfind(PlayerInfo[id][pPrisonReason], "[DNRL]", true) == -1)
    {
        new 
string[128];
        
ReleasePlayerFromPrison(playerid);
        
format(string, sizeof(string), "You have accepted %s's release request.", GetPlayerNameEx(id));
        
SendClientMessageEx(playerid, COLOR_GREY, string);
    }
    else 
SendClientMessage(playerid, COLOR_GRAD1, "You cannot use this command on an inmate who has not served their initial sentence.");
    return 
1;
} 
Reply
#6

PHP код:
change
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cuff [player]"); 
to
if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cuff [player]"); 
Reply
#7

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
change
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cuff [player]"); 
to
if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cuff [player]"); 
That wasn't suppose to be there, I was comparing the two to see if there was a difference, I forgot to delete that when I pasted it.
Reply
#8

Try
pawn Код:
command(acceptrelease, playerid, params)
to
pawn Код:
command(acceptrelease, playerid, params[])
Just an idea, maybe it helps
Reply
#9

PHP код:

command
(acceptrelease, playerid, params) 

command(acceptrelease, playerid, params[])  // <-- [] 
Reply
#10

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:

command
(acceptrelease, playerid, params) 
command(acceptrelease, playerid, params[])  // <-- [] 


Gracias, REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)