17.11.2014, 04:20
Okay hey guys, so basically i'm learning to script i mean by my self.
No tuts or whatever and i tried to create hp command (heal command)
And i don't really know what am i doing wrong but please if you fixed it tell me how.
No tuts or whatever and i tried to create hp command (heal command)
And i don't really know what am i doing wrong but please if you fixed it tell me how.
PHP код:
CMD:hp(playerid, params[])
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 99)
return SendClientMessage(playerid, -1, "Your health is already full.");
else if
{
SendClientMessage(playerid, -1, "You have been healed.");
SetPlayerHealth(playerid, 100);
}
return 1;
}
return 0;
}
PHP код:
C:\Users\yan\Desktop\Lscnr(Stopped working)\gamemodes\test.pwn(127) : error 008: must be a constant expression; assumed zero
C:\Users\yan\Desktop\Lscnr(Stopped working)\gamemodes\test.pwn(129) : warning 209: function "cmd_hp" should return a value
C:\Users\yan\Desktop\Lscnr(Stopped working)\gamemodes\test.pwn(130) : error 010: invalid function or declaration
C:\Users\yan\Desktop\Lscnr(Stopped working)\gamemodes\test.pwn(132) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.