05.03.2014, 06:04
Now i got this:
And the timer:
Yet, it doesn't seem to park the vehicle yet.
pawn Код:
CMD:acar(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
if (isnull(params)) return SendClientMessage(playerid, COLOR_LGREEN, "[USAGE]{ffffff} /acar [park/help/etc]");
if (!strcmp(params, "help", true))
{
SendClientMessage(playerid, COLOR_LGREEN, "/acar help {ffffff}- List of /acar commands");
SendClientMessage(playerid, COLOR_LGREEN, "/acar park {ffffff}- Park the vehicle you are in!");
}
else if (!strcmp(params, "park", true))
{
new vehicle, Float:x, Float:y, Float:z, Float:angle;
vehicle = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
VehicleInfo[vehicle][vX] = x;
VehicleInfo[vehicle][vY] = y;
VehicleInfo[vehicle][vZ] = z;
VehicleInfo[vehicle][vA] = angle;
SaveVehicle(vehicle);
SetTimerEx("loadcar", 1000, false, "i", vehicle);
SetPlayerPos(playerid, x, y, z+3);
SendClientMessage(playerid, COLOR_LGREEN, "[Acar]{ffffff} Vehicle parked!");
}
else SendClientMessage(playerid, COLOR_LGREEN, "Use:{ffffff} /acar help for more info!");
return 1;
}
pawn Код:
forward loadcar(i);
public loadcar(i)
{
SetVehicleToRespawn(i);
}