01.02.2013, 14:19
Hello.
I want to show you my script if it's okay or there's any easy way that you can tell me.
By the way, It's working for me, but if there another easy way, it will help me.
Details:
I checked the INT of the key `Parked` in mysql, if this is -1, the vehicle didn't respawn, and if its 0+,
the vehicle had been respawned untill the next server restart and then it's find the XYZ of my vehicle.
In ongamemodeinit I did that it will be Parked=-1 automatically.
There's another easy and fast way? script: *Again, the code is working.
I think I didn't understand the results between "SELECT * FROM" and "SELECT", if you can give me examples
I'll be happy.
I want to show you my script if it's okay or there's any easy way that you can tell me.
By the way, It's working for me, but if there another easy way, it will help me.
Details:
I checked the INT of the key `Parked` in mysql, if this is -1, the vehicle didn't respawn, and if its 0+,
the vehicle had been respawned untill the next server restart and then it's find the XYZ of my vehicle.
In ongamemodeinit I did that it will be Parked=-1 automatically.
There's another easy and fast way? script: *Again, the code is working.
PHP код:
new loadstrp[128], Float:VPos[3];
cmd = strtok(cmdtext, idx);
format(query, sizeof(query), "SELECT * FROM `vehicles` WHERE `VehicleID`='%d' AND `Owner`='%s'", strval(cmd)-1, GetName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_retrieve_row()) mysql_fetch_field_row(loadstrp, "Parked");
mysql_free_result();
if(strval(loadstrp) != -1)
{
GetVehiclePos(strval(loadstrp), VPos[0], VPos[1], VPos[2]);
SetPlayerCheckpoint(playerid, VPos[0], VPos[1], VPos[2], 2);
}
else SendClientMessage(playerid, White, "You're vehicle is parked.");
I'll be happy.