/kill commands goes crazy
#1

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.


Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/kill", true) == 0)
    {
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
Reply
#3

it's must be point not comma the true command is:

Код:
	
if(strcmp(cmd, "/kill", true) == 0) {
SetPlayerHealth(playerid, 0.0);
return 1;
}
Reply
#4

Neither one of them worked out..
Reply
#5

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.
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/kill", true)==0)
{
 SetPlayerHealth(playerid, 0.0);
 return 1;
}
Reply
#7

Sorry XtreaMeR, but wasn't the code pointed out yet by Abernethy, ByFukara and me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)