[Ajuda] Subtituir CMD por TECLA!
#1

Olб pessoas, Estou aqui mais uma vez para pedir a Ajuda de voзкs!
Bom eu tenho um certo comando, E quero que ele funcione apenas com o player apertando "F"
Vou Postar o comando aqui!
Agradeзo a Todos que Ajudarem!
Quote:

COMMAND:entrar(playerid, params[])
{


// Setup local variables
new HouseID, hLevel, BusID, BusType;


SendAdminText(playerid, "/entrar", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Make sure the player isn't inside a vehicle
if (GetPlayerVehicleID(playerid) == 0)
{
// Loop through all houses
for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
{
// Check if this house exists
if (AHouseData[HouseID][PickupID] != 0)
{
// Check if the player is in range of the house-pickup
if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
{
// Check if the house is closed to the public
if (AHouseData[HouseID][HouseOpened] == false)
{
// The house isn't open to the public, so keep anyone out who isn't the owner of the house
if (House_PlayerIsOwner(playerid, HouseID) == 0)
{
// Let the player know that this house isn't open to the public and he can't enter it
SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Peзa para o Dono da casa Abria-la para o publico pois ela estб fexada!");
return 1;
}
}

// The house is open to the public, or the player trying to enter is the owner, so let the player inside the house

// Get the level of the house
hLevel = AHouseData[HouseID][HouseLevel];
// Set the worldid so other players cannot see him anymore
SetPlayerVirtualWorld(playerid, 5000 + HouseID);
// Set the player inside the interior of the house
SetPlayerInterior(playerid, AHouseInteriors[hLevel][InteriorID]);
// Set the position of the player at the spawn-location of the house's interior
SetPlayerPos(playerid, AHouseInteriors[hLevel][IntX], AHouseInteriors[hLevel][IntY], AHouseInteriors[hLevel][IntZ]);
// Also set a tracking-variable to enable /housemenu to track in which house the player is
APlayerData[playerid][CurrentHouse] = HouseID;
// Also let the player know he can use /housemenu to upgrade/exit his house
SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Olб vocк estб dentro da sua casa! Para abrir o Painel de Controle da sua casa use /Menucasa!");

// Exit the function
return 1;
}
}
}

// Loop through all player-owned businesses
for (new i; i < MAX_BUSINESSPERPLAYER; i++)
{
// Get the business-id at the selected slot from the player
BusID = APlayerData[playerid][Business][i];

// Check if the player has owned a business in this slot
if (BusID != 0)
{
// Check if the player is in range of the business-pickup
if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
{
// Get the business-type
BusType = ABusinessData[BusID][BusinessType];
// Set the worldid so other players cannot see him anymore
SetPlayerVirtualWorld(playerid, 1000 + playerid);
// Set the player inside the interior of the business
SetPlayerInterior(playerid, ABusinessInteriors[BusType][InteriorID]);

// Set the position of the player at the spawn-location of the business's interior
SetPlayerPos(playerid, ABusinessInteriors[BusType][IntX], ABusinessInteriors[BusType][IntY], ABusinessInteriors[BusType][IntZ]);
// Also set a tracking-variable to enable /busmenu to track in which business the player is
APlayerData[playerid][CurrentBusiness] = BusID;
// Also let the player know he can use /busmenu to upgrade/exit his business
SendClientMessage(playerid, 0xFFFFFFFF, "{B0C4DE}Olб vocк estб dentro da sua Empresa! Para abrir o Painel de Controle da sua Empresa use /Menuempresa!");

// Exit the function
return 1;
}
}
}
}
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}

Espero que tenham a bondade de me Ajuda #+Rep
Reply
#2

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_FIRE))
    {
        
// coisas do comando
    
}
    return 
1;

no lugar de KEY_FIRE voce pode colocar outro. ve aqui

acredito que o F seja o KEY_SECONDARY_ATTACK
Reply
#3

Ok vo tentar!
Reply
#4

Mano deu 26 erros
Reply
#5

posta a callback inteira
Reply
#6

Mano eu estou usando o PPC_Trucking, Sу para avisar!
Reply
#7

@OFF:
Esse GM PCC Truking й Portuguкs? Se sim me mande o Link Por Favor...

@Tуpic
Use o Search talvez pode-se achar sua Resposta, Maioria das vezes resolvi meus erros assim
Reply
#8

PPC_Trcuking tem vбrios, mas axei um aqui
Link: http://owned-samp.blogspot.com.br/20...neiro-03x.html
Reply
#9

cara eu acho que seja a organizaзгo, pode tar dando ma identaзгo slб.

posta a OnPlayerKeyStateChange inteira

em vez de me dar -rep, leia o que eu pedi cara, eu to tentando ajudar, tem mais alguem aqui 1:48 da madruga tentando de ajudar?
Reply
#10

tenta ae, desculpa a mб organizacao estou no celular.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if(newkeys == KEY_SECONDARY_ATTACK)
         {    
                cmd_entrar(playerid);
         }
         return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)