SA-MP Forums Archive
Will this work - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Will this work (/showthread.php?tid=263840)



Will this work - euRo - 23.06.2011



Im using vortex roleplay script, calgoon doesnt want to help


Re: Will this work - LZLo - 23.06.2011

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

don't loose the Float:


AW: Will this work - Nero_3D - 23.06.2011

what do you expect the code to do ?

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


Re: Will this work - euRo - 23.06.2011

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


Re: Will this work - euRo - 23.06.2011

Код:
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


Re: Will this work - CrazyBlob - 23.06.2011

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


Re: Will this work - euRo - 23.06.2011

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


Re: Will this work - Elorreli - 23.06.2011

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.


Re: Will this work - euRo - 23.06.2011

So where do i return?