03.11.2013, 18:45
Hello,
I need help with this.
my server dont save car position automatically.
you have to be in your vehicle and type /estacionar (/Park)
what i want is that when the player disconnect. saves all of the players cars position with out being in each car.
this is that command
I need help with this.
my server dont save car position automatically.
you have to be in your vehicle and type /estacionar (/Park)
what i want is that when the player disconnect. saves all of the players cars position with out being in each car.
this is that command
PHP код:
CMD:estacionar(playerid, params[])
{
for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
{
if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId]))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GREY, "Tu debes ser el conductor.");
new Float:x, Float:y, Float:z, Float:angle, Float:health;
GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
PlayerVehicleInfo[playerid][d][pvHealth] = health;
if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Tu vehiculo estб muy daсado para estacionarlo.");
if(Info[playerid][pLockCar] == GetPlayerVehicleID(playerid)) Info[playerid][pLockCar] = INVALID_VEHICLE_ID;
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
GetVehicleZAngle(PlayerVehicleInfo[playerid][d][pvId], angle);
SurfingCheck(GetPlayerVehicleID(playerid));
UpdatePlayerVehicleParkPosition(playerid, d, x, y, z, angle, health);
PutPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], 0);
SetPlayerArmedWeapon(playerid, 0);
new string[30 + (MAX_PLAYER_NAME * 2)];
format(string, sizeof(string), "%s estaciona su vehнculo.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
fVehSpeed[playerid] = 0.0;
return 1;
}
}
SendClientMessageEx(playerid, COLOR_GREY, "Tu necesitas estar dentro de tu vehiculo para hacer esto.");
return 1;
}