16.12.2014, 02:37
add vehicle model collumn to your database
pawn Код:
YCMD:v_park(playerid, params[], help)
{
new query[500];
if(IsPlayerInAnyVehicle(playerid))
{
if(PR[playerid][VehiclesOwned] == 0) return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] You don't even have a vehicle yet!");
new vehicleid = GetPlayerVehicleID(playerid);
if(!strcmp(PR[vehicleid][Name],PR[playerid][Name])&&(PR[vehicleid][UserID]==playerid)) //<<<<<<<<<<<
{
new Float:x, Float:y, Float:z, Float:angle,vehmodel;
GetVehicleZAngle(vehicleid, angle);
GetVehiclePos(vehicleid, x, y, z);
x = PR[playerid][parkX];
y = PR[playerid][parkY];
z = PR[playerid][parkZ];
angle = PR[playerid][Angle];
mysql_format(dbHandle, query, sizeof(query), "UPDATE `playerrelated` SET `parkX` = %f, `parkY` = %f, `parkZ` = %f, `Angle` = %f WHERE `Name` = '%s'", x, y, z, angle, GetName(playerid)); // add collumn to your SQL for vehicle model
mysql_tquery(dbHandle, query);
DestroyVehicle(vehicleid);
//also destroy the PR[vehicleid][UserID] and PR[vehicleid][Name]
}
else
{
return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] This isn't your vehicle! Therefore you can not park it!");
}
}
else return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] You are not in any vehicle!");
return 1;
}