Spawn zone
#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


Messages In This Thread
Spawn zone - by jaksimaksi - 12.12.2009, 14:54
Re: Spawn zone - by Lajko1 - 12.12.2009, 15:57
Re: Spawn zone - by jaksimaksi - 12.12.2009, 17:39
Re: Spawn zone - by wafffllesss - 12.12.2009, 18:57
solved - by jaksimaksi - 13.12.2009, 05:41
Re: Spawn zone - by wafffllesss - 13.12.2009, 10:50
Re: Spawn zone - by jaksimaksi - 14.12.2009, 14:10
Re: Spawn zone - by jaksimaksi - 15.12.2009, 14:36
Re: Spawn zone - by wafffllesss - 15.12.2009, 23:27

Forum Jump:


Users browsing this thread: 1 Guest(s)