14.08.2012, 18:59
I did This:
But it is giving These Errors:
Whats the Problem??
pawn Код:
new AlreadyHealed[MAX_PLAYERS];
AlreadyHealed[playerid] == 0; //Place this where you become the class, and when you die.
CMD:heal(playerid, params[])
{
if(gPlayerClass[playerid] == MEDIC)
{
if(AlreadyHealed[playerid] == 0)
{
new Float:health;
GetPlayerHealth(playerid, health);
if(health <= 80) SetPlayerHealth(playerid, health + 20);
else SetPlayerHealth(playerid, 100); //Prevents health going above 100. If you want to enable this, remove this line and the if statement above.
}
else return SendClientMessage(playerid, 0xFF0000FF, "Error: You already used your medic kit!");
}
else return SendClientMessage(playerid, 0xFF0000FF, "Error: You are not a medic!");
}
pawn Код:
D:\Games\UDCWAR~1\GAMEMO~1\Wars.pwn(115) : error 010: invalid function or declaration
D:\Games\UDCWAR~1\GAMEMO~1\Wars.pwn(1430) : warning 209: function "cmd_heal" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Whats the Problem??