help "KEY_WALK"
#1

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 
VehicleIDFloat:XFloat:YFloat:ZFloat:Angle;
            
GetPlayerPos(playeridXYZ);
            
VehicleID GetPlayerVehicleID(playerid);
            
GetVehicleZAngle(VehicleIDAngle);
            
SetVehiclePos(VehicleIDXYZ);
            
SetVehicleZAngle(VehicleIDAngle);
            
SetVehicleHealth(VehicleID,1000.0);
            
SendCommandToAdmins(playerid,"Flip");
            return 
SendClientMessage(playeridgreen,"|- Vehicle Flipped! -|") &&
            
SendClientMessage(playeridwhite,"Flip the player's vehicle? (/flip [PlayerID])");
            }
            else return 
SendClientMessage(playerid,red,"He Thong: You are not in a Vehicle!");
        }
        new 
player1playername[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 
VehicleIDFloat:XFloat:YFloat:ZFloat:Angle;
                
GetPlayerPos(player1XYZ);
                
VehicleID GetPlayerVehicleID(player1);
                
GetVehicleZAngle(VehicleIDAngle);
                
SetVehiclePos(VehicleIDXYZ);
                
SetVehicleZAngle(VehicleIDAngle);
                
SetVehicleHealth(VehicleID,1000.0);
                
GetPlayerName(player1playernamesizeof(playername));
                
GetPlayerName(playeridadminnamesizeof(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(playeridblue,string);
            }
            else return 
SendClientMessage(playerid,red,"He Thong: This player isn't in a vehicle");
        }
        else return 
ErrorMessages(playerid4);
    }
    else return 
ErrorMessages(playerid1);

Reply
#2

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
  if (
newkeys == KEY_WALK)
     {
            if(
IsPlayerInAnyVehicle(playerid))
            {
            new 
VehicleIDFloat:XFloat:YFloat:ZFloat:Angle;
            
GetPlayerPos(playeridXYZ);
            
VehicleID GetPlayerVehicleID(playerid);
            
GetVehicleZAngle(VehicleIDAngle);
            
SetVehiclePos(VehicleIDXYZ);
            
SetVehicleZAngle(VehicleIDAngle);
            
SetVehicleHealth(VehicleID,1000.0);
          }
        }
        return 
1;

Made some modification and here you go.
Reply
#3

Quote:
Originally Posted by karan007
Посмотреть сообщение
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
  if (
newkeys == KEY_WALK)
     {
            if(
IsPlayerInAnyVehicle(playerid))
            {
            new 
VehicleIDFloat:XFloat:YFloat:ZFloat:Angle;
            
GetPlayerPos(playeridXYZ);
            
VehicleID GetPlayerVehicleID(playerid);
            
GetVehicleZAngle(VehicleIDAngle);
            
SetVehiclePos(VehicleIDXYZ);
            
SetVehicleZAngle(VehicleIDAngle);
            
SetVehicleHealth(VehicleID,1000.0);
          }
        }
        return 
1;

Made some modification and here you go.
Ok . Thank
Reply
#4

Quote:
Originally Posted by quochuy
Посмотреть сообщение
Ok . Thank
No problem, test it and tell me if it works or not because i didn't test it.And if it doesn't works, i'll make another one for you.
Reply


Forum Jump:


Users browsing this thread: