need example
#1

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

Код:
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;
}
Reply
#3

how about to make the spawns random ?
Reply
#4

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);
Reply
#5

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]);
Reply
#6

alright, I've understood, thank you.
Reply
#7

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

buummp
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)