23.06.2011, 19:05
Код:
CMD:park(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command!"); if(playerVariables[playerid][pCarID] == GetPlayerVehicleID(playerid)) { if(playerVariables[playerid][pCarModel] >= 1 && doesVehicleExist(playerVariables[playerid][pCarID])) { new Float: vPos[4]; // x, y, z + z angle GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]); GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]); playerVariables[playerid][pCarPos][0] = vPos[0]; playerVariables[playerid][pCarPos][1] = vPos[1]; playerVariables[playerid][pCarPos][2] = vPos[2]; playerVariables[playerid][pCarPos][3] = vPos[3]; SendClientMessage(playerid, COLOR_GREY, "You have parked your vehicle"); } else return SendClientMessage(playerid, COLOR_GREY, "You do not own a vehicle"); } else return SendClientMessage(playerid, COLOR_GREY, "This is not your vehicle"); return 1; }
Will it park the players car and not someone elses etc