help gives one warning...
#1

hey guys.. why does this give a warning?

Код:
  	if (strcmp("/kill",cmdtext,true)==0) {
		if(GetPlayerHealth(playerid) == 0) {
		SendClientMessage(playerid,BRIGHTRED,"You are already dead.");
		return 1; }
		else {
			new name[MAX_PLAYER_NAME];
      new string[256];
			GetPlayerName(playerid, name, sizeof(name));
			format(string, sizeof(string), "*** %s commited suicide ***", name);
			printf("*** %s commited suicide ***", name);
			SendClientMessageToAll(LEMON, string);
			SetPlayerHealth(playerid,00.00);
			return 1; } }
Код:
C:\SAMPSE~1\FILTER~1\manhunt.pwn(249) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
the warning line is:

Код:
if(GetPlayerHealth(playerid) == 0) {
help plz? thnx.
Reply
#2

If you used the wiki you'd realise that's not how GetPlayerHealth works.

https://sampwiki.blast.hk/wiki/GetPlayerHealth

GetPlayerHealth(playerid,Float:health);

So you'd have to use:

New Float:Health;
GetPlayerHealth(playerid, Health);
if(Health == 0) //blah
Reply
#3

Quote:
Originally Posted by Weirdosport
If you used the wiki you'd realise that's not how GetPlayerHealth works.
lol xD hehe i havent worked with GetPlayerHealth for a long time.. forgot how to use it. where do i go to? :P
Reply
#4

https://sampwiki.blast.hk/wiki/GetPlayerHealth
Reply
#5

And stop creating new arrays (which are oversized anyway) in every command. Declare them globally and save space.
Reply
#6

lol ok.. thnx a lot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)