25.08.2012, 00:29
Ok so I made a dynamic garage system for my server...evertything is cool but every garage has it's own VW.
And when i /park a car in the garage it sets the car's VW to 0 again....
I tried with GetPlayerVirtualWorld...tried with SetVehicleVirtual world and it's still the same...if anyone can help i will apreciate it
Here is the /park CMD:
And when i /park a car in the garage it sets the car's VW to 0 again....
I tried with GetPlayerVirtualWorld...tried with SetVehicleVirtual world and it's still the same...if anyone can help i will apreciate it
Here is the /park CMD:
pawn Код:
CMD:park(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle.");
if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle you can park.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your vehicle, it will always spawn here until you park it somewhere else.");
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{
for(new i=0; i<14; i++)
{
PlayerInfo[playerid][pVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVeh], i);
}
GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
DestroyVehicle(PlayerInfo[playerid][pVeh]);
PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],1200);
ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
SetVehicleToRespawn(PlayerInfo[playerid][pVeh]);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
}
}
return 1;
}