SA-MP Forums Archive
/Park help. Please help. - 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: /Park help. Please help. (/showthread.php?tid=77168)



/Park help. Please help. - Snyper - 09.05.2009

I installed a FS into my gamemode and unfortunetly the /park feature doesn't work with the /respawnvehicles command from the original gamemode.
Whenever I use /respawnvehicles, it never touches anything I admin-parked, it does respawn the /park cars. All the cars go back to where you bought them and never save where they should.

Quote:

else if (strcmp("/park", cmde, true, 10) == 0)
{
if (IsPlayerInVehicle(playerid,Carlist[playerid][Carid]))
{
GetVehiclePos(Carlist[playerid][Carid],Carlist[playerid][X],Carlist[playerid][Y],Carlist[playerid][Z]);
GetVehicleZAngle(Carlist[playerid][Carid],Carlist[playerid][Rotation]);
SendClientMessage(playerid, COLOR_GREEN, "[INFO:] Your vehicle will now respawn here.");
SaveDynamicCars();
}
else { SendClientMessage(playerid, COLOR_GREY, "[ERROR:] That is not your car, or you are not in one!"); }
return 1;
}

Is my FS's normal park command.
Quote:

if(strcmp(cmd, "/acarpark", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new car = GetPlayerVehicleID(playerid) - 1;
new Float,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
DynamicCars[car][CarX] = x;
DynamicCars[car][CarY] = y;
DynamicCars[car][CarZ] = z;
DynamicCars[car][CarAngle] = a;
DestroyVehicle(vehicleid);
CreateVehicle(DynamicCars[car][CarModel],DynamicCars[car][CarX],DynamicCars[car][CarY],DynamicCars[car][CarZ],DynamicCars[car][CarAngle],DynamicCars[car][CarColor1],DynamicCars[car][CarColor2], -1);
PutPlayerInVehicle(playerid,vehicleid,0);
SaveDynamicCars();

new wstring[128];
format(wstring, sizeof(wstring), "You have parked Vehicle ID: %d.", vehicleid);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not an administrator.");
}
}
return 1;
}

Which is my admin car park command.

How could I make it so my script understands that I don't want to teleport my cars when I use /respawnvehicles.


Re: /Park help. Please help. - Snyper - 09.05.2009

Please help.