SA-MP Forums Archive
Help, +Rep - 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: Help, +Rep (/showthread.php?tid=362000)



Help, +Rep - Peter Alex - 23.07.2012

I want to CreateObject once I pass through the radius of the IsPlayerInRangeOfPoint(playerid, 1.0, 172.67, -151.92, 1.81)) - I've tried creating the object, however I'm not doing something good:

Код:
	public OnPlayerSpawn(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 172.67, -151.92, 1.81))
   	pObject2[playerid] = CreatePlayerObject(playerid, 12923, 158.3594, -176.3047, 5.5703, 0, 0, 0, 300.0);
	return 1;
}



Re: Help, +Rep - SnG.Scot_MisCuDI - 23.07.2012

try:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 172.67, -151.92, 1.81))
    {
        pObject2[playerid] = CreatePlayerObject(playerid, 12923, 158.3594, -176.3047, 5.5703, 0, 0, 0, 300.0);
        print("Object created"); //check in the rcon console for this message upon spawning
    }
    return 1;
}



Re: Help, +Rep - newbienoob - 23.07.2012

IsPlayerInRangeOfPoint won't work under OnPlayerSpawn. Read this
https://sampforum.blast.hk/showthread.php?tid=358162