Problem with the ZAngle
#1

Hello!

I have a little problem. I did a little command to create some vehicles. When I want to park these with an extra command so the vehicle destroys and creates again to save the positions (so that when the vehicle destroys that it will spawn at the latest position).
But: The ZAngle doesn't update and this vehicle will stand always in the equal direction.

PHP код:
ocmd:apark(playerid,params[])
{
    if(
Player[playerid][pAdmin] < 5)return SendClientMessage(playerid,-1,"{b65e5e}Fehler:{FFFFFF} Du besitzt nicht die Rechte fьr diesen Befehl!");
    if(!
IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,-1,"{b65e5e}Fehler:{FFFFFF} Du bist in keinem Fahrzeug!");
    new 
Float:X,Float:Y,Float:Z,Float:A,string[20],query[200];
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,A);
    for(new 
i,j=MAX_POLICE_CARS;i<j;i++)
    {
        if(
PoliceCars[i][polVehID] == GetPlayerVehicleID(playerid))
        {
            
mysql_format(handle,query,sizeof(query),"UPDATE `policecars` SET `parkx`='%f',`parky`='%f',`parkz`='%f',`parka`='%f' WHERE `db_id`='%d'",X,Y,Z,A,PoliceCars[i][polDB_ID]);
            
mysql_tquery(handle,query,"","");
            
SetVehicleZAngle(PoliceCars[i][polVehID],A);
            
DestroyVehicle(PoliceCars[i][polVehID]);
            
PoliceCars[i][polVehID] = CreateVehicle(PoliceCars[i][polModel],X,Y,Z,A,PoliceCars[i][polFarbe1],PoliceCars[i][polFarbe2],-1,0);
            
format(string,sizeof(string),"PD%04d",PoliceCars[i][polVehID]);
            
SetVehicleNumberPlate(PoliceCars[i][polVehID],string);
            
SendClientMessage(playerid,-1,"{30983c}** Du hast das Polizeifahrzeug erfolgreich umgeparkt!");
            
PutPlayerInVehicle(playerid,PoliceCars[i][polVehID],0);
            return 
1;
        }
    }
    return 
1;

That's the park command.

I know that's a samp bug, but how can I fix this?

Best wishes.
Reply


Messages In This Thread
Problem with the ZAngle - by Mencent - 04.03.2017, 21:42
Re: Problem with the ZAngle - by GoldenLion - 04.03.2017, 22:05
Re: Problem with the ZAngle - by Mencent - 04.03.2017, 22:14

Forum Jump:


Users browsing this thread: 4 Guest(s)