SA-MP Forums Archive
Scripting Help with Playertopoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Scripting Help with Playertopoint (/showthread.php?tid=496967)



Scripting Help with Playertopoint - tysanio - 24.02.2014

Hello, i got my problem with PlayertoPoint
I Want to do if the player is in range and in interior 0

They to something

Here my code

PHP код:
public UpdateRadiation()
{
    for(new 
0MAX_PLAYERSi++)
       {
           new 
Float:Vie;
        if(
IsPlayerConnected(i) && AdminDuty[i] == && PlayerInfo[i][pJail] == 0)
        {
            if(
PlayerToPoint(1090.0i,1915,1790,10.5048))
            {
                
GetPlayerHealth(i,Vie);
                
SetPlayerHealth(i,Vie-2);
                
GameTextForPlayer(i,"~r~Radioation Zone!",5000,3);
            }
        }
    }

This is my got for interior

PlayerInfo[i][pInt] == 0

I dont know where to put it?

Any help?


Re: Scripting Help with Playertopoint - tysanio - 24.02.2014

Any ones no?


Re: Scripting Help with Playertopoint - Konstantinos - 24.02.2014

pawn Код:
if (GetPlayerInterior(i) == 0)
{
    // code..
}
or
pawn Код:
if (!GetPlayerInterior(i))
{
    // code..
}
and it's recommended not to use PlayerToPoint but IsPlayerInRangeOfPoint instead.


Re: Scripting Help with Playertopoint - tysanio - 24.02.2014

Thx the first code Work perfect!


Re: Scripting Help with Playertopoint - MP2 - 24.02.2014

If you need SCRIPTING HELP, post in the SCRIPTING HELP forum.