09.12.2015, 00:22
Alright so the problem is simple, if you /park a vehicle, it will respawn at wrong Angle angle for some reason
And yes the angle is a float
print
The problem happens after I use SetVehicleToRespawn on it
PHP код:
CMD:park(playerid,params[]) {
#pragma unused params
new vid = GetPlayerVehicleID(playerid), Float:tmpPos[4], vw, Int;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not inside any vehicle");
if(VehInfo[vid][VehMasterID] == AccInfo[playerid][ID] || VehInfo[vid][VehFaction] == AccInfo[playerid][PlayerFaction] && AccInfo[playerid][PlayerLeader]) {
GetVehiclePos(vid,tmpPos[0],tmpPos[1],tmpPos[2]);
GetVehicleZAngle(vid,tmpPos[3]);
vw = GetVehicleVirtualWorld(vid);
Int = GetPlayerInterior(playerid);
SendClientMessage(playerid,COLOR_GREEN,"You have parked your vehicle");
VehInfo[vid][VehPosX] = tmpPos[0];
VehInfo[vid][VehPosY] = tmpPos[1];
VehInfo[vid][VehPosZ] = tmpPos[2];
VehInfo[vid][VehPosA] = tmpPos[3];
VehInfo[vid][VehInterior] = Int;
VehInfo[vid][VehWorld] = vw;
new query[128];
mysql_format(mysql, query, sizeof(query), "UPDATE `vehicles` SET `PosX`=%f,`PosY`=%f,`PosZ`=%f,`PosA`=%f WHERE ID=%d",tmpPos[0],tmpPos[1],tmpPos[2],tmpPos[3],VehInfo[vid][VID]);
mysql_tquery(mysql, query);
}
return true;
}
public OnVehicleSpawn(vehicleid)
{
SetVehiclePos(vehicleid,VehInfo[vehicleid][VehPosX],VehInfo[vehicleid][VehPosY],VehInfo[vehicleid][VehPosZ]);
SetVehicleZAngle(vehicleid,VehInfo[vehicleid][VehPosA]);
SetVehicleVirtualWorld(vehicleid,VehInfo[vehicleid][VehWorld]);
LinkVehicleToInterior(vehicleid,VehInfo[vehicleid][VehInterior]);
return 1;
}
PHP код:
Float:VehPosA,
PHP код:
printf("Server ID: %i || SQL ID: %i",vid,VehInfo[vid][VID]);
printf("%.2f",tmpPos[3]);
printf("%.2f",VehInfo[vid][VehPosA]);
[02:27:52] Server ID: 40 || SQL ID: 65
[02:27:52] 326.46
[02:27:52] 326.46
The problem happens after I use SetVehicleToRespawn on it