Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local model = GetTok(text, " ", 1);
- if (!model) MessagePlayer("/" + cmd + " [model] [colour1] [colour2]", player);
- else if (!IsNum(model)) MessagePlayer("[#FF0000][ ERROR ] Car model must be a number.", player);
- else
- {
- local cor1 = GetTok(text, " ", 2);
- if (!cor1) MessagePlayer("/" + cmd + " [model] [colour1] [colour2]", player);
- else if (!IsNum(cor1)) MessagePlayer("[ ERROR ] Car colour1 must be a number.", player);
- else
- {
- local cor2 = GetTok(text, " ", 3);
- if (!cor2) MessagePlayer("/" + cmd + " [model] [colour1] [colour2]", player);
- else if (!IsNum(cor2)) MessagePlayer("[ ERROR ] Car colour2 must be a number.", player);
- else
- {
- local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z, angle = player.Angle;
- player.Pos.z += 2;
- CreateVehicle(model.tointeger(), 0, Vector(x.tofloat(), y.tofloat(), z.tofloat()), angle.tofloat(), cor1.tointeger(), cor2.tointeger());
- QuerySQL(db, "INSERT INTO `Cars` VALUES ( '" + GetVehicleCount() + "', '" + FindVehicle(GetVehicleCount()).Model + "', '1', 'None', 'None', '', '', '0', '0', '0', '0', '" + cor1 + "', '" + cor2 + "', '" + x.tofloat() + "', '" + y.tofloat() + "', '" + z.tofloat() + "', '" + angle.tofloat() + "' )");
- ClientMessageToAll("* Admin [" + rgbtohex(player.Colour.r, player.Colour.g, player.Colour.b) + "]" + player.Name + "[$FF] has added a [#FFFFFF]" + GetVehicleNameFromCustomModel(model.tointeger()) + "[$FF] in " + GetDistrictName(player.Pos.x, player.Pos.y) + ". *", 190, 190, 190);
- CarStats.append( GetVehicleCount() );
- CarStats[GetVehicleCount()] = CarClass();
- CarStats[GetVehicleCount()].ID = GetVehicleCount();
- CarStats[GetVehicleCount()].Model = FindVehicle(GetVehicleCount()).Model;
- CarStats[GetVehicleCount()].Price = 0;
- CarStats[GetVehicleCount()].Owner = "None";
- CarStats[GetVehicleCount()].Shared = "None";
- CarStats[GetVehicleCount()].XP = 0;
- CarStats[GetVehicleCount()].YP = 0;
- CarStats[GetVehicleCount()].ZP = 0;
- CarStats[GetVehicleCount()].Angle = 0;
- CarStats[GetVehicleCount()].Col1 = cor1.tointeger();
- CarStats[GetVehicleCount()].Col2 = cor2.tointeger();
- CarStats[GetVehicleCount()].XO = x.tofloat();
- CarStats[GetVehicleCount()].YO = y.tofloat();
- CarStats[GetVehicleCount()].ZO = z.tofloat();
- CarStats[GetVehicleCount()].OAngle = angle.tofloat();
- MessagePlayer("[#01DFA5]Vehicle successfully added to Database.", player);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement