Creating /explode - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Creating /explode (
/showthread.php?tid=248529)
Creating /explode - Max_Coldheart - 14.04.2011
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

?
Re: Creating /explode -
Ironboy500[TW] - 14.04.2011
"SendClientMessage(playerid, -1, "USAGE: /explode [id/partofname]");"
Instead of writing -1, you should define message color.
Re: Creating /explode - Max_Coldheart - 14.04.2011
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.
Re: Creating /explode -
Seven_of_Nine - 14.04.2011
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..)
Re: Creating /explode - Max_Coldheart - 14.04.2011
oh fuck I forgot the [], Thanks, Just logical mistake, fixed it.