Creating /explode
#1

Okay so this is my /explode CMD, with ZCMD & sscanf

pawn Код:
CMD:explode(playerid, params)
{
    if(PlayerInfo[playerid][pAdminLevel] >= 2)
    {
        new string[128], id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerPos(id, Float:x, Float:y, Float:z);
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /explode [id/partofname]");
        CreateExplosion(Float:x, Float:y, Float:z, 0, 30);
        SendClientMessage(id, grey, "   You were exploded");
        format(string, sizeof(string), "You just exploded %s", name);
        SendClientMessage(playerid, LIGHTBLUE, string);
        return 1;
    }
    return 1;
}
errors I have:
pawn Код:
C:\Users\Max\Desktop\GTA San Andreas\samp03csvr_win32\filterscripts\ColdAdmin.pwn(530) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Line of error:
pawn Код:
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /explode [id/partofname]");
but I see nothing wrong. why I get error?
Reply
#2

"SendClientMessage(playerid, -1, "USAGE: /explode [id/partofname]");"

Instead of writing -1, you should define message color.
Reply
#3

I have defined white, but -1 works everywhere else but there. So it couldnt be it, could it?

EDIT: Changed it to defined color, still the same problem

OMG: This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
Reply
#4

Try this:
pawn Код:
CMD:explode(playerid,params[])
instead of

pawn Код:
CMD:explode(playerid,params)
because pawn don't like when you want to sscanf a string into an integer (I think so..)
Reply
#5

oh fuck I forgot the [], Thanks, Just logical mistake, fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)