/kill commands goes crazy - 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: /kill commands goes crazy (
/showthread.php?tid=81679)
/kill commands goes crazy -
Tisca - 13.06.2009
http://pastebin.com/m31f793a9
I cant figure out what the problem is, eventhough it gives me this:
C:\Users\Alex\Desktop\Random Shit\BadassRP.pwn(194) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
And line 194 is the SetPlayerHealth thingy.
Regards Alex.
Re: /kill commands goes crazy -
Abernethy - 13.06.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kill", true) == 0)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
Re: /kill commands goes crazy -
ByFukara - 13.06.2009
it's must be point not comma the true command is:
Код:
if(strcmp(cmd, "/kill", true) == 0) {
SetPlayerHealth(playerid, 0.0);
return 1;
}
Re: /kill commands goes crazy -
Tisca - 13.06.2009
Neither one of them worked out..
Re: /kill commands goes crazy -
ZaZa - 13.06.2009
That must work, otherwise you're doing it wrong.
Just look
Код:
SetPlayerHealth(playerid, 0,0);
In that code you give 3 parameters, which are:
playerid
0
0
But SetPlayerHealth requires 2 parameters, which are:
playerid
health amount
So you must do
Код:
SetPlayerHealth(playerid, 0.0);
So it would be zero point zero (player will die), not zero comma zero.
Re: /kill commands goes crazy -
Burridge - 13.06.2009
pawn Код:
if(strcmp(cmdtext, "/kill", true)==0)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
Re: /kill commands goes crazy -
ZaZa - 13.06.2009
Sorry XtreaMeR, but wasn't the code pointed out yet by Abernethy, ByFukara and me?