Spawn Car At Player Chors ???
#1

How can i get a car to spawn if i type like /alpha. But car spawns at my postion and chors
Reply
#2

Colors Idk but here is the code so the car spawn on your possition

Код:
    if(strcmp(cmd, "/nrg500", true) == 0) {
		new Float:x, Float:y, Float:z, Float:a;
		GetPlayerFacingAngle(playerid,a);
		GetPlayerPos(playerid, x, y, z);
		new car;
		car=CreateVehicle(522,x,y,z+4,a,-1,-1,30000);   //change 522 to the car that you want spawn
		LinkVehicleToInterior(car,GetPlayerInterior( playerid));
		PutPlayerInVehicle(playerid,car,0);
		if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
		PlayerInfo[playerid][pCar] = car;
		return 1;}
I hope it helps you
Reply
#3

Quote:
Originally Posted by caribe88
Colors Idk but here is the code so the car spawn on your possition

Код:
   if(strcmp(cmd, "/nrg500", true) == 0) {
		new Float:x, Float:y, Float:z, Float:a;
		GetPlayerFacingAngle(playerid,a);
		GetPlayerPos(playerid, x, y, z);
		new car;
		car=CreateVehicle(522,x,y,z+4,a,-1,-1,30000);   //change 522 to the car that you want spawn
		LinkVehicleToInterior(car,GetPlayerInterior( playerid));
		PutPlayerInVehicle(playerid,car,0);
		if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
		PlayerInfo[playerid][pCar] = car;
		return 1;}
I hope it helps you
Thanks :P
Reply
#4

Well Your code didnt work the way i wanted so i edited it :L

Код:
   if(strcmp(cmd, "/nrg500", true) == 0) {
        new Float:x, Float:y, Float:z, Float:a;
		GetPlayerFacingAngle(playerid,a);
		GetPlayerPos(playerid, x, y, z);
		new car;
		car=CreateVehicle(522,x,y,z+1,a,-1,-1,30000);   //change 522 to the car that you want spawn
		LinkVehicleToInterior(car,GetPlayerInterior( playerid));
		return 1;}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)