27.04.2015, 14:23
How to edit dcmd_flip a > KEY_WALK ?? .
PHP код:
dcmd_flip(playerid,params[])
{
if(AccInfo[playerid][Level] >= 0)
{
if(!strlen(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);
SendCommandToAdmins(playerid,"Flip");
return SendClientMessage(playerid, green,"|- Vehicle Flipped! -|") &&
SendClientMessage(playerid, white,"Flip the player's vehicle? (/flip [PlayerID])");
}
else return SendClientMessage(playerid,red,"He Thong: You are not in a Vehicle!");
}
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
{
SendCommandToAdmins(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);
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"|- Nguoi choi %s Flipped your Vehicle -|",adminname);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"You have Flipped %s's Vehicle!", playername);
return SendClientMessage(playerid, blue,string);
}
else return SendClientMessage(playerid,red,"He Thong: This player isn't in a vehicle");
}
else return ErrorMessages(playerid, 4);
}
else return ErrorMessages(playerid, 1);
}