Spawn zone
#1

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
Reply
#2

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 ...
Reply
#3

anywhere, i just need a example
Reply
#4

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..
Reply
#5

solved
Reply
#6

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.
Reply
#7

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
Reply
#8

Could someone help? -_-
Reply
#9

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) || ...)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)