Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:park(playerid, params[])
- {
- new string[128], idd;
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You aren't in any vehicle!");
- new car = GetPlayerVehicleID(playerid);
- new car1 = PlayerInfo[playerid][pCarKey1], car2 = PlayerInfo[playerid][pCarKey2], car3 = PlayerInfo[playerid][pCarKey3], car4 = PlayerInfo[playerid][pCarKey4], car5 = PlayerInfo[playerid][pCarKey5];
- new valid = PlayerInfo[playerid][pCarKey1] + PlayerInfo[playerid][pCarKey2] + PlayerInfo[playerid][pCarKey3] + PlayerInfo[playerid][pCarKey4] + PlayerInfo[playerid][pCarKey5];
- if(valid == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu ai un vehicul personal!");
- if(car == CarInfo[car1][Spawned]) idd = PlayerInfo[playerid][pCarKey1];
- if(car == CarInfo[car2][Spawned]) idd = PlayerInfo[playerid][pCarKey2];
- if(car == CarInfo[car3][Spawned]) idd = PlayerInfo[playerid][pCarKey3];
- if(car == CarInfo[car4][Spawned]) idd = PlayerInfo[playerid][pCarKey4];
- if(car == CarInfo[car5][Spawned]) idd = PlayerInfo[playerid][pCarKey5];
- if(CarInfo[idd][Spawned] != car) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You aren't in that vehicle!");
- if(idd == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Acest vehicul nu iti apartine!");
- new Float:x, Float:y, Float:z, Float:a;
- GetVehiclePos(car, x, y, z);
- GetVehicleZAngle(car, a);
- CarInfo[idd][cLocationx] = x;
- CarInfo[idd][cLocationy] = y;
- CarInfo[idd][cLocationz] = z;
- CarInfo[idd][cAngle] = a;
- DestroyVehicle(car);
- CarInfo[idd][Spawned] = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],CarInfo[idd][cColorOne],CarInfo[idd][cColorTwo],-1);
- SetVehicleNumberPlate(CarInfo[idd][Spawned], CarInfo[idd][cLicense]);
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationx='%f' WHERE ID=%d", CarInfo[idd][cLocationx], idd);
- mysql_tquery(SQL, string, "", "");
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationy='%f' WHERE ID=%d", CarInfo[idd][cLocationy], idd);
- mysql_tquery(SQL, string, "", "");
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationz='%f' WHERE ID=%d", CarInfo[idd][cLocationz], idd);
- mysql_tquery(SQL, string, "", "");
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Angle='%f' WHERE ID=%d", CarInfo[idd][cAngle], idd);
- mysql_tquery(SQL, string, "", "");
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[idd][Spawned], idd);
- mysql_tquery(SQL, string, "", "");
- GameTextForPlayer(playerid, "~w~You have parked your car at this spot.", 2000, 4);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement