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!");
}
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.
new AlreadyHealed[MAX_PLAYERS];
stock AlreadyHealed[playerid] == 0;
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!");
}
D:\Games\UDCWAR~1\GAMEMO~1\Wars.pwn(1417) : error 017: undefined symbol "playerid"
D:\Games\UDCWAR~1\GAMEMO~1\Wars.pwn(1432) : warning 209: function "cmd_heal" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
new AlreadyHealed[MAX_PLAYERS];
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!");
return 1;
}
AlreadyHealed[playerid] == 0; //Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
//Place this where you become the class, and when you die.
new AlreadyHealed[MAX_PLAYERS];
stock AlreadyHealed[playerid] == 0;
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!");
return 1;
}
pawn Код:
|
public OnPlayerConnect(playerid)
{
AlreadyHealed[playerid] == 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
AlreadyHealed[playerid] == 0;
return 1;
}
All you did was add return 1;, which is exactly what I did. You didn't even help him with the other error
@Omar, You really do not deserve reputation because you cannot even do a simple fucking thing. Here pawn Код:
|