Saving and Loading vehicles problem
#2

PHP код:
CMD:park(playeridparams[])
{
    if(
pInfo[playerid][pModerator] > || pInfo[playerid][pAdminLevel] >= 1)
    {
        new 
vehid;
        if(
sscanf(params"i"vehid)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /park [vehid]");
        if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not driving the vehicle!");
            return 
1;
        }
        new 
id GetVehicleID(GetPlayerVehicleID(playerid));
        new 
Query[500];
        new 
FloatXFloatYFloatZFloatR;
        
GetVehiclePos(vehidXYZ);
        
GetVehicleZAngle(vehidR);
        
mysql_format(dbHandle,Querysizeof(Query), "UPDATE `vehicles` SET `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f', `PosA` = '%f' WHERE `ID` = '%d'",
        
X,
        
Y,
        
Z,
        
R,
        
vehid);
        
mysql_query(dbHandle,Query,false);
        
        
mysql_format(dbHandle,Querysizeof(Query), "UPDATE `vehicles` SET `Color1` = '%d', `Color2` = '%d' WHERE `ID` = '%d'",
        
vInfo[id][vColor1],
        
vInfo[id][vColor2],
        
vehid);
                
mysql_query(dbHandle,Query,false);
        new 
str[128];
        
format(strsizeof(str), "The vehicles position is X:%f Y:%f Z:%f"XYZ);
        
SendClientMessage(playerid, -1str);
        
DestroyVehicle(vehid);
        
VehicleID[vehid] = AddStaticVehicle(vInfo[id][vModel], XYZRvInfo[id][vColor1], vInfo[id][vColor2]);
        
    }
    else return 
SendClientMessage(playeridCOLOR_GREY"You are not authorised to use that command.");
    return 
1;

Reply


Messages In This Thread
Saving and Loading vehicles problem - by Blademaster680 - 04.07.2014, 16:36
Re: Saving and Loading vehicles problem - by DarkZeroX - 04.07.2014, 16:47
Re: Saving and Loading vehicles problem - by Blademaster680 - 04.07.2014, 17:19

Forum Jump:


Users browsing this thread: 3 Guest(s)