Will this work
#1



Im using vortex roleplay script, calgoon doesnt want to help
Reply
#2

GetVehicleZAngle([playerid][pCarID], playerVariables[playerid][pCarPos][3]);

don't loose the Float:
Reply
#3

what do you expect the code to do ?

you just save something in pCarPos 0 - 3 and than you overwrite it again...
Reply
#4

Ye i compliled it and it gives problems

Basically i want the car to park at the location it is in :/ and onvehicledestroy it will spawn at the location you parked it
Reply
#5

Код:
CMD:park(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command!");
	if(playerVariables[playerid][pCarID] == GetPlayerVehicleID(playerid)) {

		if(playerVariables[playerid][pCarModel] >= 1 && doesVehicleExist(playerVariables[playerid][pCarID])) {
		
  			new
     			Float: vPos[4]; // x, y, z + z angle
     			
 		    GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
		    GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]);

      	  	    playerVariables[playerid][pCarPos][0] = vPos[0];
           	    playerVariables[playerid][pCarPos][1] = vPos[1];
           	    playerVariables[playerid][pCarPos][2] = vPos[2];
	       	    playerVariables[playerid][pCarPos][3] = vPos[3];

		    SendClientMessage(playerid, COLOR_GREY, "You have parked your vehicle");
		}
		else return SendClientMessage(playerid, COLOR_GREY, "You do not own a vehicle");
	}
	else return SendClientMessage(playerid, COLOR_GREY, "This is not your vehicle");
	return 1;
}
Ok i changed it up compiles fine, but are variables right.

Will it park the players car and not someone elses etc
Reply
#6

obviously it'll park other players cars it'll take a little more scripting to fix that
Reply
#7

It seems to be working fine tho, am i missing something or does the code seem right that only the player that owns it can park it and only if you own a car
Reply
#8

Just a notice, you're returning it before the message, which means It never will be shown if you park the car.

Should get an "Unreachable Code" warning.
Reply
#9

So where do i return?
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)