29.07.2015, 23:11
How can I possibly combine the licenseplate system with MySQL?
Here is the CMD:
Car enum:
Here is the CMD:
Код:
CMD:licenseplate(playerid,params[]) { if(PlayerData[playerid][pLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be level 1 use this command"); if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid,-1,"Error: You have to be the driver of a vehicle to change its licence plate"); new VehicleID = GetPlayerVehicleID(playerid), LModel = GetVehicleModel(VehicleID); switch(LModel) { case 448,461,462,463,468,471,509,510,521,522,523,581,586, 449: return SendClientMessage(playerid,-1,"ERROR: You can not tune this vehicle"); } new plate[32]; if(sscanf(params,"s[32]",plate)) return SendClientMessage(playerid,-1,"Correct Usage : /licenseplate [PLATE] "); new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]); SetVehicleNumberPlate(VehicleID, plate); SetVehicleToRespawn(VehicleID); SetVehiclePos(VehicleID, pos[0], pos[1], pos[2]); SetTimerEx("TuneLCar",4000,0,"d",VehicleID); PutPlayerInVehicle(playerid,VehicleID,0); PlayerPlaySound(playerid,1133,0.0,0.0,0.0); return 1; }
Код:
enum carData { carID, carExists, carModel, carOwner, Float:carPos[4], carColor1, carColor2, carPaintjob, carLocked, carMods[14], carImpounded, carImpoundPrice, carFaction, carWeapons[5], carAmmo[5], carVehicle };