[Ajuda] Entrando/Saindo interiores
#1

Hola, gostaria de saber eu fiz um sistema de teleporte, so que queria que teleportasse apertando "F" mais esta auto se teleportando, gostaria de ajuda:

pawn Код:
new armas1;
new sarmas1;

armas1 = CreatePickup(1318, 1, 1791.8861,-1163.1324,23.8281,-1);
sarmas1 = CreatePickup(1318, 1, 315.7863,-143.5840,999.6016,-1);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys==KEY_SECONDARY_ATTACK))
    {
       OnPlayerCommandReceived(playerid,"/entrandoint");
       OnPlayerCommandReceived(playerid,"/sairdoint");
    }
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == armas1)
    {
        SetPlayerPos(playerid, 315.761840, -143.515014, 999.601562);
        SetPlayerInterior(playerid, 7);
    }
    if(pickupid == sarmas1)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 1791.8861,-1163.1324,23.8281);
    }
    return 1;
}
/*          Comandos        */

CMD:entrarint(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1791.8861,-1163.1324,23.8281))
    {
        SetPlayerPos(playerid, 315.761840, -143.515014, 999.601562);
        SetPlayerInterior(playerid, 7);
    }
    return true;
}
CMD:sairint(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 315.761840, -143.515014, 999.601562))
    {
        SetPlayerPos(playerid, 1791.8861,-1163.1324,23.8281);
        SetPlayerInterior(playerid, 7);
    }
    return true;
}
Gracias.
Reply
#2

pawn Код:
OnPlayerCommandReceived(playerid,"/entrandoint");
       OnPlayerCommandReceived(playerid,"/sairdoint");

       CMD:entrarint(playerid, params[])
       CMD:sairint(playerid, params[])

Persebeu alguma diferenзa?
Reply
#3

nao funcionaste assim
Reply
#4

Tu teleportaste automaticamente pela razгo de teres a public obplayerpickup. Apaga o que tг lб dentro e vai funcionar com a tecla F. Estou no celular nгo tem como eu passar direito o cod.
Reply
#5

pawn Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 204: symbol is assigned a value that is never used: "armas1"
warning 204: symbol is assigned a value that is never used: "sarmas1"

4 Warnings.
Removendo da isso.
Reply
#6

Apaga as variaveis "armas1" e "sarmas1".
Reply
#7

Isso irб ajuda-lo: OnPlayerKeyStateChange.

Exemplo de uso:
PHP код:
if(newkeys == KEY_ID)
{
   
// Funзгo das pickups.

Reply
#8

Compilou normal mais aperto F e nгo entra =/
Reply
#9

Em vez de colocares. OnPlayerCommandReceived(playerid,"/entrandoint"); coloca isso: cmd_entrarint(playerid, ""); faz o mesmo para o outro
Reply
#10

Muito obrigado Darck.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)