SA-MP Forums Archive
Vehicle dissapears when i use /v park - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle dissapears when i use /v park (/showthread.php?tid=608447)



Vehicle dissapears when i use /v park - justjamie - 01.06.2016

title.
code:
pawn Код:
else if(!strcmp(tmp, "park", true, 4))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid, "You are not in any vehicle!");
        if(GetAdminLevel(playerid) < 5) return SendClientError(playerid, CANT_USE_CMD);
        new Float:a[4];
        GetVehiclePos(GetPlayerVehicleID(playerid), a[0], a[1], a[2]);
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a[3]);
        new query[420];
        new i = GetPlayerVehicleID(playerid);
        format(query,sizeof(query),"UPDATE (x,y,z,a) VALUES (%f,%f,%f,%f) WHERE id='%i'",a[0],a[1],a[2],a[3],cInfo[i][db_id]);
        mysql_function_query(dbhandle,query,false,"","");
        cInfo[i][c_x] = a[0];
        cInfo[i][c_y] = a[1];
        cInfo[i][c_z] = a[2];
        cInfo[i][c_r] = a[3];
        ReloadVehicle(GetPlayerVehicleID(playerid));
        Up(playerid);
        SetTimerEx("PutPlayerInVehicleEx", 500, false, "dd", playerid, i);
        SendClientInfo(playerid, "Success: The vehicle is now parked.");
    }
also; i get this mysql error:
[13:00:29] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1529.757690,-1729.473754,13.009142,207.501159) WHERE id='0'' at line 1


Re: Vehicle dissapears when i use /v park - BR3TT - 01.06.2016

The error is just saying that the query isn't written properly so it cannot be executed which may lead to your command not working. The car may be disappearong because its coordinates aren't saving and when the car reloads it probably goes somewhere else in the server.


Re: Vehicle dissapears when i use /v park - justjamie - 01.06.2016

Quote:
Originally Posted by BR3TT
Посмотреть сообщение
The error is just saying that the query isn't written properly so it cannot be executed which may lead to your command not working. The car may be disappearong because its coordinates aren't saving and when the car reloads it probably goes somewhere else in the server.
It isn't going anywhere on the server, because i can call it to me, normally it works, after i /v park it, it can't call it anymore.