help gives one warning... - 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: help gives one warning... (
/showthread.php?tid=86273)
help gives one warning... -
[GF]sIdEkIcK - 12.07.2009
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.
Re: help gives one warning... -
Weirdosport - 12.07.2009
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
Re: help gives one warning... -
[GF]sIdEkIcK - 12.07.2009
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
Re: help gives one warning... -
Klutty - 12.07.2009
https://sampwiki.blast.hk/wiki/GetPlayerHealth
Re: help gives one warning... -
Weirdosport - 12.07.2009
And stop creating new arrays (which are oversized anyway) in every command. Declare them globally and save space.
Re: help gives one warning... -
[GF]sIdEkIcK - 12.07.2009
lol ok.. thnx a lot.