SA-MP Forums Archive
Spawn zone - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn zone (/showthread.php?tid=113151)



Spawn zone - jaksimaksi - 12.12.2009

Hi how i can make a spawn zone, like zone in ls, sf, lv and in that zone players can spawn cars? I have car spawning script. I just need to create that zone, can someone can teach me? thx


Re: Spawn zone - Lajko1 - 12.12.2009

uff sorry but i think u must explain more what exactly u want ... what zone this should be etc ... and where should be this zone ...


Re: Spawn zone - jaksimaksi - 12.12.2009

anywhere, i just need a example


Re: Spawn zone - wafffllesss - 12.12.2009

Quote:
Originally Posted by jaksimaksi
Hi how i can make a spawn zone, like zone in ls, sf, lv and in that zone players can spawn cars? I have car spawning script. I just need to create that zone, can someone can teach me? thx
Go to your game in Debug Mode. Save the places you want.

Then.. use a code like this:
Код:
if(Your Spawn Command){
 if(IsPlayerInRangeOfPoint(playerid,DISTANCE,X,Y,Z)){
   Your Spawn Function.
 }else{
   SendClientMessage(playerid,COLOR_RED,"You're not in a spawn zone.");
 }
}
Distance: the float distance from the point (e.g. 20.0).
X,Y,Z: The coords you saved from the places..


solved - jaksimaksi - 13.12.2009

solved


Re: Spawn zone - wafffllesss - 13.12.2009

Quote:
Originally Posted by jaksimaksi
Can you make me the code? this is car spawning script:
Код:
	new Float: angl;
	GetPlayerFacingAngle(playerid, angl);
  new Float: cx, Float: cy, Float: cz;
	GetPlayerPos(playerid, cx, cy, cz);
	{
	}
	{
		for(new i; i < 24; i++)
		{
    	if(params[0] == CarNames[i][0] && params[1] == CarNames[i][1] && params[2] == CarNames[i][2])
			{
        new id = CreateVehicle(CarIds[i], cx, cy, cz, angl, 3, 1, never);
        PlayerPlaySound(i,1047,0.0,0.0,0.0);
        PutPlayerInVehicle(playerid, id, 0);
				return 1;
			}
		}
    return SendClientMessage(playerid, AAD_COLOR_GREY, "This vehicle dont exist");
	}
}
My spawn zone:
Код:
0.1807,2470.0994,16.4844
Thanks.
Код:
	
    new Float: angl;
	GetPlayerFacingAngle(playerid, angl);
    new Float: cx, Float: cy, Float: cz;
	GetPlayerPos(playerid, cx, cy, cz);
    if(IsPlayerInRangeOfPoint(playerid,20.0,0.1807,2470.0994,16.4844))
	{
		for(new i; i < 24; i++)
		{
     	if(params[0] == CarNames[i][0] && params[1] == CarNames[i][1] && params[2] == CarNames[i][2])
			{
        new id = CreateVehicle(CarIds[i], cx, cy, cz, angl, 3, 1, never);
        PlayerPlaySound(i,1047,0.0,0.0,0.0);
        PutPlayerInVehicle(playerid, id, 0);
				return 1;
			}
		}
    return SendClientMessage(playerid, AAD_COLOR_GREY, "This vehicle dont exist");
	}else SendClientMessage(playerid,0xAA3333AA,"You're not in the spawn zone");
}
This Should work... if you got an error like "undefined symbol IsPlayerInRangeOfPoint" then you need to include 'a_npc' at the top of your script.


Re: Spawn zone - jaksimaksi - 14.12.2009

Thx, how should i make a more coordinates on it? like
Код:
2300.3691,2465.9958,-7.4531
2303.6707,2462.3679,-7.4531
2295.4915,2462.5503,-7.4531
2305.9221,2467.1360,-7.4531
2307.6660,2461.4766,-7.4531
2310.6240,2463.6145,-7.4531
2310.8337,2467.3267,-7.4531
2307.1555,2469.0911,-7.4531
2302.5771,2471.1018,-7.4531
2296.9460,2473.2600,-7.4531



Re: Spawn zone - jaksimaksi - 15.12.2009

Could someone help? -_-


Re: Spawn zone - wafffllesss - 15.12.2009

Quote:
Originally Posted by jaksimaksi
Could someone help? -_-
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,20.0,0.1807,2470.0994,16.4844) || IsPlayerInRangeOfPoint(playerid,20.0,ANOTHER_X,ANOTHER_Y,ANOTHER_Z) || ...)