09.05.2014, 12:10
pawn Код:
CMD:flip(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
if(isnull(params)) {
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(playerid, X, Y, Z); VehicleID = GetPlayerVehicleID(playerid);
GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); SetVehicleHealth(VehicleID,1000.0);
CMDMessageToAdmins(playerid,"FLIP"); return SendClientMessage(playerid, blue,"Vehicle Flipped. You can also do /flip [playerid]");
} else return SendClientMessage(playerid,red,"Error: You are not in a vehicle. You can also do /flip [playerid]");}
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
CMDMessageToAdmins(playerid,"FLIP");
if (IsPlayerInAnyVehicle(player1)) {
new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(player1, X, Y, Z); VehicleID = GetPlayerVehicleID(player1);
GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); SetVehicleHealth(VehicleID,1000.0);
RepairVehicle(VehicleID);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"You have flipped %s's vehicle", playername);
return SendClientMessage(playerid, blue,string);
} else return SendClientMessage(playerid,red,"Error: This player isn't in a vehicle");
} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");}