23.06.2010, 17:49
anyideas?
cmd(flip, playerid, params[]) { if(!sscanf(params, "u", playerid)) { if(File[playerid][Admin] >= 1) { new VehicleID; GetPlayerPos(playerid, X, Y, Z); VehicleID = GetPlayerVehicleID(playerid); GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); GameTextForPlayer(playerid,"~b~FLIPPED!",4000,3); SendClientMessage(playerid, BLUE, "FLIPPED!"); } } return 1; }
CMD:fix(playerid, params[]) { if(File[playerid][Admin] > 0) { new vehicleid; vehicleid = GetPlayerVehicleID(user); RepairVehicle(vehicleid); } return 1; } CMD:flip(playerid, params[]) { if(File[playerid][Admin] >= 1) { new VehicleID,Angle; VehicleID = GetPlayerVehicleID(user); new Float:x, Float:y, Float:z; GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); GameTextForPlayer(playerid,"~b~FLIPPED!",4000,3); } return 1; }
if(!strcmp(cmd, "/repair", true, 7) || strcmp(cmd, "/fix", true, 4) == 0)
{
new Float:vehhealth;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, vehhealth);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"ERROR: not in a vehicle!");
if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to repair the vehicle");
SetVehicleHealth(veh,1000);
RepairVehicle(veh);
SendClientMessage(playerid, COLOR_GREEN,"You have repaired your vehicle");
return 1;
}
if(strcmp("/flip", cmdtext, true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"ERROR: not in a vehicle!");
if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to flip the vehicle");
new vehicle;
new Float:angle;
vehicle = GetPlayerVehicleID(playerid);
GetVehicleZAngle(vehicle, angle);
SetVehicleZAngle(vehicle, angle);
SendClientMessage(playerid, COLOR_GREEN, "You have flipped your vehicle");
return 1;
}