SA-MP Forums Archive
need example - 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: need example (/showthread.php?tid=492841)



need example - Equuuuin0X - 05.02.2014

so, I intends to make fun server, I wanted to make a command which teleports you and gets you in a car.

here's a code from my friend

http://pastebin.com/4E6qXYzQ

I really need example.


Re: need example - Ghazal - 05.02.2014

Код:
dcmd_hydra(playerid,params[])
{
SetPlayerPos(playerid,2494.4041,-1666.5985,13.3438);
new Float:x, Float:y, Float:z, Float:angle;
		GetPlayerPos(playerid, x, y, z);
	 	GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(520, x, y, z, angle, -1, -1, -1);
		PutPlayerInVehicle(playerid, vehicleid, 0);
		SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
		LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
		ChangeVehicleColor(vehicleid,0,3);
return 1;
}



Re: need example - Equuuuin0X - 05.02.2014

how about to make the spawns random ?


Re: need example - Vanter - 05.02.2014

pawn Код:
new Float:CopsRandomSpawns[][] =
{
    {2292.58, 2459.78, 10.82, 90.0},    // COPS SPAWN
    {2273.70, 2445.85, 3.53, 90.0},     // COPS SPAWN
    {2272.78, 2488.29, -7.45, 90.0}     // COPS SPAWN
};

new Random = random(sizeof(CopsRandomSpawns));
        SetPlayerPos(playerid, CopsRandomSpawns[Random][0], CopsRandomSpawns[Random][1], CopsRandomSpawns[Random][2]);
        SetCameraBehindPlayer(playerid);



Re: need example - HammerHeadZ - 05.02.2014

Example

You store all spawns in this array
pawn Код:
new Float:Spawns[5][4] ={
    {2109.4585,919.2332,10.8203,209.6226},
    {2323.5815,1283.3816,97.4613,252.0876},
    {2180.7927,1285.2844,42.7996,83.3940},
    {1479.1537,2120.1230,24.1066,247.9501},
    {1779.4329,2821.8000,8.3359,20.4845}
};
then In onplayerspawn (example) you will use random function using the spawns array

pawn Код:
new rand = random(sizeof Spawns);
        SetPlayerPos(playerid,Spawns[rand][0],Spawns[rand][1],Spawns[rand][2]);



Re: need example - Equuuuin0X - 05.02.2014

alright, I've understood, thank you.


Re: need example - Equuuuin0X - 05.02.2014

also, could you make example whole codes to make command teleports you and gets you in a car,and the command has minigame basic system, I mean, there are maps, loading every 20 minutes or so. please


Re: need example - Equuuuin0X - 07.02.2014

buummp