#1

I have tried to add "IsPlayerCloseToEnemy" in my script but it dosn't work, what is this name of the function? I mean, the player can't /armour close to a enemy..
Reply
#2

Ermm I am not sure what you want to say but try with
pawn Код:
if(IsPlayerInRzngeOfPoint(playerid, range, X, Y, Z))
Reply
#3

C:\Documents and Settings\Lindvall\Skrivbord\Stor map\Qk server\gamemodes\QKDM.pwn(307) : error 017: undefined symbol "range"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

if(IsPlayerInRangeOfPoint(playerid, 7.0, -29.1218,-185.1289,1003.5469))

Like...
7.0 makes the distance.
X - -29.1218
Y - -185.1289
Z - -185.1289,1003.5469

You can change 7.0 as much as you want.
Reply
#5

You should be able to /shop anywhere except close to enemies..
Reply
#6

Are you using ZCMD or strcmp?
Reply
#7

Technically there is no function called IsPlayerCloseToEnemy And IsPlayerInRangeOfPoint is static you cant use it like that
Reply
#8

I am using strcmp
Reply
#9

pawn Код:
stock IsPlayerCloseToEnemy(playerid)
{
    new bool:returnval = false, Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); //store the players position in our Pos array
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            //check if anyone is close to that position that's on a different team
            if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2]) && GetPlayerTeam(i) != GetPlayerTeam(playerid))
            {
                //if so, we're going to return true
                returnval = true;
                break;
            }
        }
    }
    //if not it's going to return false as that's what returnval defaults at
    return returnval;
}
Reply
#10

This ain't working...

pawn Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
    {
        {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]) && GetPlayerTeam(i) != GetPlayerTeam(playerid));
            return 1;
        }
        GivePlayerMoney(playerid, -1000);
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)