Wrong Angle
#1

Alright so the problem is simple, if you /park a vehicle, it will respawn at wrong Angle angle for some reason

PHP код:
CMD:park(playerid,params[]) {
    
#pragma unused params
    
new vid GetPlayerVehicleID(playerid), Float:tmpPos[4], vwInt;
    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(mysqlquerysizeof(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(mysqlquery);
    }
    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;

And yes the angle is a float
PHP код:
Float:VehPosA
print
PHP код:
printf("Server ID: %i || SQL ID: %i",vid,VehInfo[vid][VID]);
printf("%.2f",tmpPos[3]);
printf("%.2f",VehInfo[vid][VehPosA]);
[
02:27:52Server ID40 || SQL ID65
[02:27:52326.46
[02:27:52326.46 

The problem happens after I use SetVehicleToRespawn on it
Reply


Messages In This Thread
Wrong Angle - by TwinkiDaBoss - 09.12.2015, 00:22
Re: Wrong Angle - by Kevln - 09.12.2015, 00:34
Re: Wrong Angle - by TwinkiDaBoss - 09.12.2015, 00:39
Re: Wrong Angle - by jamesbond007 - 09.12.2015, 01:19
Re: Wrong Angle - by Threshold - 09.12.2015, 01:20
Re: Wrong Angle - by Kevln - 09.12.2015, 03:02
Re: Wrong Angle - by TwinkiDaBoss - 09.12.2015, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)