Is this right?
#1

I need to ask here cuz I can't test on my own :/

Is this code right or is there any mistake?

pawn Код:
stock IsPlayerBehindPlayer(playerid,targetid,Float:distance,Float:range)
{
    if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid))return 0;
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);//my pos
        GetXYInBehindPlayer(targetid,x,y,distance);
        if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))return 1;
    }
    return 0;
}
pawn Код:
stock GetXYInBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    a -= 180.0;
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
What I want to detect are coords behind player for /cuff and /uncuff cmd ^^, thanks for checking and answering.
Reply
#2

What is going wrong ?
Reply
#3

Well nothing is wrong I just want to know if this is right code to detect coords behind another player? I wouldn't post that if I would be able to test with my friend but I can't port forward... :/
Reply
#4

Quote:
Originally Posted by Lajko1
Посмотреть сообщение
Well nothing is wrong I just want to know if this is right code to detect coords behind another player? I wouldn't post that if I would be able to test with my friend but I can't port forward... :/
Advice, try to port forward because you must always test your server man.
Reply
#5

Quote:
Originally Posted by Clad
Посмотреть сообщение
Advice, try to port forward because you must always test your server man.
Seriously man, I'm asking under Server Support for help also I'm asking on Portforward.com for help I'm not getting any answers how to solve this error when I want to port forward:

"IP ERROR: LAN Side IP Address
description: Out of LAN side network address range"

if you can help go ahead

Anyway on topic I would like someone to check that code I posted for me if it will work, thanks alot.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)