Error while compiling
#1

Код:
if (strcmp("/izlaz", cmdtext, true, 10) == 0)
{
if (PlayerToPoint(8.0, playerid,286.148987,-40.644398,1001.569946))//ovde stavite xyz interijera
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2400.4590,-1981.2649,13.5469);//ovde stavite xyz ulaza
}
}
if (strcmp("/ulaz", cmdtext, true, 10) == 0)
{
if (PlayerToPoint(8.0, playerid,2400.4590,-1981.2649,13.5469))//XYZ Ulaza
{
SetPlayerInterior(playerid,1); //interijer gun shopa
SetPlayerPos(playerid,286.148987,-40.644398,1001.569946);//XYZ interijera Gun Shopa (uradjeno)
}
}
    return 1;
}
errors
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(317) : error 017: undefined symbol "PlayerToPoint"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(325) : error 017: undefined symbol "PlayerToPoint"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
help
Reply
#2

now warnings tag mismatch
Код:
#define PlayerToPoint IsPlayerInRangeOfPoint
Reply
#3

IsPlayerInRangeOfPoint(playerid, Float:range, Float, Float:y, Float:z);

Use playerid insteand of 8.0:
IsPlayerInRangeOfPoint(playerid, 8.0, 2400.4590,-1981.2649,13.5469)
Reply
#4

dont fixed
Reply
#5

i fix with public
Reply
#6

Add this somewhere in your script but remember, NOT UNDER ANY CALLBACKS! Just anywhere. Hope it works.

Advice: Use IsPlayerInRangeOfPoint instead of using this one. It's faster and easier to use.

Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Floatldposx, Floatldposy, Floatldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz      < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
Reply
#7

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
(playerid, Float:range, Float, Float:y, Float:z)
Your parameters are in the wrong order than the native, you need to reorder them in the define.
PHP код:
#define PlayerToPoint(%0,%1,%2) IsPlayerInRangeOfPoint(%1,%0,%2) 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)