/heal ID
#7

Add this somewhere in your script:

pawn Код:
stock GetDistanceBetweenPlayers(playerid,playerid2)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    GetPlayerPos(playerid2,x2,y2,z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
Then add this to your /heal command

pawn Код:
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 5)
{
  SendClientMessage(playerid,0x87CEEBAA, "Player is not close enough to heal")
    return 1;
}
Reply


Messages In This Thread
/heal ID - by Crusty - 21.06.2010, 13:32
Re: /heal ID - by ViruZZzZ_ChiLLL - 21.06.2010, 13:37
Re: /heal ID - by Crusty - 21.06.2010, 13:39
Re: /heal ID - by Naxix - 21.06.2010, 13:57
Re: /heal ID - by aircombat - 21.06.2010, 14:48
Re: /heal ID - by RatHack - 21.06.2010, 14:57
Re: /heal ID - by MWF2 - 21.06.2010, 15:15

Forum Jump:


Users browsing this thread: 1 Guest(s)