16.09.2016, 16:25
Alright. I'll keep your post in bookmark. Thanks.
I seem barely but.. I'm trying to do my best. x)
This code doesn't work.
If you need english translate, say it. Sorry. '-'
I seem barely but.. I'm trying to do my best. x)
This code doesn't work.
PHP код:
CMD:garer(playerid)
{
if(pAccount[playerid][pAdmin] < SADMIN) return ErrorMsg(playerid, _, false);
new vehicleid = GetPlayerVehicleID(playerid),
Float:x,
Float:y,
Float:z;
if(vehicleid == INVALID_VEHICLE_ID) return ErrorMsg(playerid, "Vous devez кtre dans un vйhicule.");
GetVehiclePos(vehicleid, x, y, z);
DB::Fetch("Vehicle", _, _, _, "`ID` = '%d'", vehicleid);
if (fetch_rows_count() > 0)
{
AdminMessage(playerid, "Changement des stats du vйhicule ID: %i.", vehicleid);
DB::Update("ID", vStats[vehicleid][vSQLIB], 3,
"x", FLOAT, x,
"y", FLOAT, y,
"z", FLOAT, z);
}
else
{
vStats[vehicleid][vSQLIB] = fetch_row_id();
DB::CreateRow("Vehicle",
"ID", INTEGER, vStats[vehicleid][vSQLIB],
"Model", INTEGER, GetVehicleModel(vehicleid),
"VehicleID", INTEGER, vehicleid);
AdminMessage(playerid, "Vйhicule ID:%i en cours de crйation ...", vehicleid);
AdminMessage(playerid, "Enregistrement des donnйes ...");
vStats[vehicleid][vSQLIB] = fetch_row_id();
vStats[vehicleid][vID] = vehicleid;
vStats[vehicleid][vX] = x;
vStats[vehicleid][vY] = y;
vStats[vehicleid][vZ] = z;
vStats[vehicleid][vColor1] = random(150);
vStats[vehicleid][vColor2] = random(150);
vStats[vehicleid][vHealth] = 1500.0;
vStats[vehicleid][vModel] = GetVehicleModel(vehicleid);
vStats[vehicleid][vRespawn] = 1800;
format(vStats[vehicleid][vPlate], 10, GetARandomPlate());
AdminMessage(playerid, "Donnйes enregistrйes. Attributions des nouvelles donйes au vйhicule.");
ChangeVehicleColor(vehicleid, vStats[vehicleid][vColor1], vStats[vehicleid][vColor2]);
RepairVehicle(vehicleid);
SetVehicleHealth(vehicleid, vStats[vehicleid][vHealth]);
SaveVehicleStats(vehicleid);
AdminMessage(playerid, "Attributions terminйes.");
}
fetcher_close();
return 1;
}