30.04.2011, 11:06
im trying to make a Medic Player
so i got this
the problem is that it comes up with There Is No Player's To Heal Near You
and i dont even know if the other things are going to work. Need alot of hel pPLS
so i got this
pawn Code:
//At the top
new Float:Hx[MAX_PLAYERS],Float:Hy[MAX_PLAYERS],Float:Hz[MAX_PLAYERS];
new healid[MAX_PLAYERS];
//then i got this
public OnPlayerUpdate(playerid)
{
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health<=10 && NeedHeal[playerid]<=2)
{
ApplyAnimation(playerid,"SWEET","Sweet_injuredloop",4.1,1,0,0,0,0,0);
if(NeedHeal[playerid]==0)
{
TogglePlayerControllable(playerid,false);
GetPlayerPos(playerid,Hx[playerid],Hy[playerid],Hz[playerid]);
Heal[playerid] = CreatePickup(1318, 23, Hx[playerid], Hy[playerid], Hz[playerid]+2, -1);
playerid = healid[playerid];
}
NeedHeal[playerid] ++;
}
}
//And for te medic to type /Heal
COMMAND:heal(playerid, params[])
{
LoadPlayerClass(playerid);
if(!strcmp("Medic",ClassInfo,true))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, Hx[playerid], Hy[playerid], Hz[playerid]))
{
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,1,1);
SetTimer("HealPlayer",3000,false);
}else return SendClientMessage(playerid,RED,"There Is No Player's To Heal Near You");
}
return 1;
}
//then the timer
forward HealPlayer(playerid);
public HealPlayer(playerid)
{
for(new i; i < MAX_PLAYERS; i ++)
{
TogglePlayerControllable(healid[i],true);
ClearAnimations(healid[i]);
DestroyPickup(Heal[i]);
SetPlayerHealth(healid[i],100);
}
}
and i dont even know if the other things are going to work. Need alot of hel pPLS