Portal SAMP
[Ajuda] Criar Pickup - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Criar Pickup (/showthread.php?tid=611)



Criar Pickup - LeleziiN - 05/01/2021

Bom como posso criar um Pickup para um interior de hospital tipo, eu tenho um interior de hospital que fiz, mais fui criar uma Pickup para saída do interior e a pickup não foi criada. Já tentei com CreatePickup e com AddStaticPickup e nenhum sucess.

Podem mim ajuda pfvr, ficarem agradecido


RE: Criar Pickup - Hazard - 05/01/2021

em qual callback você está criando ela?


RE: Criar Pickup - LeleziiN - 05/01/2021

(05/01/2021 21:12)Hazard Escreveu: em qual callback você está criando ela?

OnGameModeInit

Eu criei para entrar no interior ai fui criar para sair, mais a puxou o para sair não está criando mais, a Create3DTextLabel aparece mais a puxou o n


RE: Criar Pickup - Hazard - 05/01/2021

os objetos do interior estão vinculado a algum virtual world?


RE: Criar Pickup - xbruno1000x - 05/01/2021

Uma dica foda pra você não ter mais esses problemas:

Use o EnEx.INC
https://burgershot.gg/showthread.php?tid=1178

Na OnGameModeInit
Código:
Enex_Create(entX, entY, entZ, entAng, exiX, exiY, exiZ, exiAng, worldid, interiorid);

Com ele, você pode criar Pickups, MapIcon, e congelar o player ao entrar em um local com objetos dinâmicos.

Ajudaria muito no seu caso.


RE: Criar Pickup - LeleziiN - 06/01/2021

(05/01/2021 22:52)Hazard Escreveu: os objetos do interior estão vinculado a algum virtual world?

Não

(05/01/2021 23:02)xbruno1000x Escreveu: Uma dica foda pra você não ter mais esses problemas:

Use o EnEx.INC
https://burgershot.gg/showthread.php?tid=1178

Na OnGameModeInit
Código:
Enex_Create(entX, entY, entZ, entAng, exiX, exiY, exiZ, exiAng, worldid, interiorid);

Com ele, você pode criar Pickups, MapIcon, e congelar o player ao entrar em um local com objetos dinâmicos.

Ajudaria muito no seu caso.


Vou tentar aqui

Pq asse por em quanto para sair do hospital eu fiz por comando /SairHosp, mais não queria asse.


RE: Criar Pickup - LeleziiN - 07/01/2021

tá ir as variáveis do meu código:

Código PHP:
#include <a_samp>
#include <streamer>

new iconehosp1iconehosp2iconehosp3iconehosp4iconehosp5iconesairhosp;

public 
OnGameModeInit()
{
    
iconehosp1 CreatePickup(1318231172.4631,-1323.2786,15.4029); //HOSP LS 1
    
iconehosp2 CreatePickup(1318232034.1473,-1402.5370,17.2946); //HOSP LS 2
    
iconehosp3 CreatePickup(131823, -320.1926,1049.4722,20.3403); //FC
    
iconehosp4 CreatePickup(131823, -2655.1528,638.8937,14.4531); //SF
    
iconehosp5 CreatePickup(1318231607.3455,1816.4760,10.8203); //LV
    
iconesairhosp CreatePickup(1239231177.3695,-1340.4095,9280.5693,-1); //INTERIOR HOSP
    
    
Create3DTextLabel("Hospital de LS"0xFFFFFFFF1172.4631,-1323.2786,15.40295000);
    
Create3DTextLabel("Hospital de LS2"0xFFFFFFFF2034.1473,-1402.5370,17.29465000);
    
Create3DTextLabel("Hospital de FC"0xFFFFFFFF, -320.1926,1049.4722,20.34035000); //FC
    
Create3DTextLabel("Hospital de SF"0xFFFFFFFF, -2655.1528,638.8937,14.45315000); //SF
    
Create3DTextLabel("Hospital de LV"0xFFFFFFFF1607.3455,1816.4760,10.82035000); //LV
    
Create3DTextLabel("Sair Hospital\n{1e90ff}/SairHosp"0xFFFFFFFF1177.3695,-1340.4095,9280.56935000);
    
    
//Hospital - Interior
    CreateObject(14595,1175.05078125,-1328.92089844,9283.52246094,0.00000000,0.00000000,0.00000000); //object(paperchase02) (1)
    CreateObject(5020,1178.11718750,-1340.39355469,9281.22070312,0.00000000,0.00000000,0.00000000); //object(mul_las) (1)
    CreateObject(5020,1178.11621094,-1340.39746094,9282.38867188,0.00000000,0.00000000,0.00000000); //object(mul_las) (2)
    CreateObject(14598,1175.03491211,-1328.92651367,9283.51562500,0.00000000,0.00000000,0.00000000); //object(paperchase_glass) (1)
    CreateObject(1523,1174.26074219,-1315.62304688,9279.56933594,0.00000000,0.00000000,0.00000000); //object(gen_doorext10) (1)
    CreateObject(1704,1170.88537598,-1333.26599121,9279.56933594,0.00000000,0.00000000,180.00000000); //object(kb_chair03) (1)
    CreateObject(1704,1167.13879395,-1325.55065918,9279.56933594,0.00000000,0.00000000,59.99938965); //object(kb_chair03) (2)
    CreateObject(1726,1169.29589844,-1324.67285156,9279.56933594,0.00000000,0.00000000,0.00000000); //object(mrk_seating2) (1)
    CreateObject(2293,1170.42285156,-1331.69628906,9279.49316406,0.00000000,0.00000000,0.00000000); //object(swk_1_fstool) (1)
    CreateObject(3383,1170.69042969,-1305.55371094,9279.56933594,0.00000000,0.00000000,270.00000000); //object(a51_labtable1_) (1)
    CreateObject(1671,1180.88574219,-1332.81640625,9280.02929688,0.00000000,0.00000000,159.99938965); //object(swivelchair_a) (1)
    CreateObject(1705,1182.30761719,-1329.62500000,9279.56933594,0.00000000,0.00000000,319.49890137); //object(kb_chair04) (1)
    CreateObject(2008,1180.47851562,-1331.94335938,9279.56933594,0.00000000,0.00000000,0.00000000); //object(officedesk1) (1)
    CreateObject(1705,1179.29589844,-1330.18066406,9279.56933594,0.00000000,0.00000000,50.74584961); //object(kb_chair04) (2)
    CreateObject(1808,1183.95117188,-1324.01953125,9279.56933594,0.00000000,0.00000000,319.99877930); //object(cj_watercooler2) (1)
    CreateObject(1808,1177.81542969,-1334.52636719,9279.54980469,0.00000000,0.00000000,265.99548340); //object(cj_watercooler2) (2)
    CreateObject(630,1179.38964844,-1324.77050781,9280.59472656,0.00000000,0.00000000,0.00000000); //object(veg_palmkb8) (1)
    CreateObject(632,1165.56054688,-1325.03710938,9280.01855469,0.00000000,0.00000000,0.00000000); //object(veg_palmkb7) (1)
    CreateObject(2245,1169.67956543,-1326.65368652,9280.30957031,0.00000000,0.00000000,0.00000000); //object(plant_pot_11) (1)
    CreateObject(2251,1167.75500488,-1331.84020996,9280.84375000,0.00000000,0.00000000,0.00000000); //object(plant_pot_20) (1)
    CreateObject(8659,1158.04785156,-1329.11425781,9280.56933594,0.00000000,0.00000000,90.00000000); //object(shbbyhswall11_lvs) (1)
    CreateObject(8659,1158.03710938,-1329.11816406,9282.56542969,0.00000000,0.00000000,90.00000000); //object(shbbyhswall11_lvs) (2)
    CreateObject(1997,1159.63012695,-1304.87231445,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (1)
    CreateObject(1997,1161.32995605,-1304.96093750,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (2)
    CreateObject(1997,1163.31799316,-1304.97705078,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (3)
    CreateObject(1997,1165.15136719,-1304.99511719,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (4)
    CreateObject(1997,1166.90063477,-1305.08386230,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (5)
    CreateObject(1997,1168.62402344,-1305.17089844,9279.56933594,0.00000000,0.00000000,0.00000000); //object(hos_trolley) (6)
    CreateObject(1663,1161.26855469,-1340.80761719,9280.03613281,0.00000000,0.00000000,129.99572754); //object(swivelchair_b) (1)
    CreateObject(2009,1161.20410156,-1339.68261719,9279.56933594,0.00000000,0.00000000,270.00000000); //object(officedesk2l) (1)
    CreateObject(2182,1160.41992188,-1342.13964844,9279.76660156,0.00000000,0.00000000,90.00000000); //object(med_office5_desk_1) (1)
    CreateObject(1727,1164.51782227,-1340.79711914,9279.57617188,0.00000000,0.00000000,239.99818420); //object(mrk_seating2b) (1)
    CreateObject(1727,1163.76611328,-1338.29174805,9279.56933594,0.00000000,0.00000000,309.99572754); //object(mrk_seating2b) (2)
    CreateObject(1808,1162.06445312,-1342.57324219,9279.54980469,0.00000000,0.00000000,185.99304199); //object(cj_watercooler2) (3)
    CreateObject(2921,1177.98413086,-1345.60217285,9282.83789062,0.00000000,0.00000000,330.00000000); //object(kmb_cam) (1)
    CreateObject(2921,1158.33374023,-1324.11962891,9282.86621094,0.00000000,0.00000000,189.99633789); //object(kmb_cam) (2)
    CreateObject(2921,1158.86291504,-1342.73022461,9282.51660156,0.00000000,0.00000000,259.99206543); //object(kmb_cam) (3)
    CreateObject(2921,1183.56713867,-1323.83264160,9282.76855469,0.00000000,0.00000000,89.99145508); //object(kmb_cam) (4)
    CreateObject(2921,1171.99426270,-1316.56140137,9282.96093750,0.00000000,0.00000000,139.98901367); //object(kmb_cam) (5)
    CreateObject(3391,1175.07373047,-1305.24548340,9279.56933594,0.00000000,0.00000000,0.00000000); //object(a51_sdsk_ncol2_) (1)
    CreateObject(3390,1175.03552246,-1308.79077148,9279.56933594,0.00000000,0.00000000,0.00000000); //object(a51_sdsk_ncol1_) (1)
    CreateObject(3395,1173.14868164,-1304.05212402,9279.56933594,0.00000000,0.00000000,90.00000000); //object(a51_sdsk_3_) (1)
    CreateObject(1726,1165.95532227,-1333.03588867,9279.56933594,0.00000000,0.00000000,90.00000000); //object(mrk_seating2) (3)
    CreateObject(2370,1167.54455566,-1332.17419434,9279.16308594,0.00000000,0.00000000,0.00000000); //object(shop_set_1_table) (1)
    CreateObject(2370,1169.28820801,-1327.00036621,9279.18847656,0.00000000,0.00000000,0.00000000); //object(shop_set_1_table) (2)
    CreateObject(2855,1168.29309082,-1331.32019043,9280.00976562,0.00000000,0.00000000,0.00000000); //object(gb_bedmags05) (1)
    CreateObject(2852,1170.00463867,-1326.30114746,9280.03515625,0.00000000,0.00000000,0.00000000); //object(gb_bedmags02) (1)
    CreateObject(1997,1160.23461914,-1335.54052734,9279.56933594,0.00000000,0.00000000,90.00000000); //object(hos_trolley) (6)
    CreateObject(1240,1174.99108887,-1315.88146973,9282.52148438,0.00000000,0.00000000,0.00000000); //object(health) (1)
    CreateObject(1241,1164.36645508,-1333.81457520,9282.55859375,0.00000000,0.00000000,0.00000000); //object(adrenaline) (1)
    
return 1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/sairhosp"true)==0)
    {
        if(PlayerToPoint(1.0playerid1177.3695,-1340.4095,9280.5693))
        {
            SetPlayerInterior(playerid0);
            if(PlayerNoHospital[playerid] == 1SetPlayerPos(playerid1176.3164,-1324.1117,14.0154);
            else if(PlayerNoHospital[playerid] == 2SetPlayerPos(playerid2032.5037,-1407.6497,17.1777);
            else if(PlayerNoHospital[playerid] == 3SetPlayerPos(playerid, -315.8423,1055.3075,19.7422);
            else if(PlayerNoHospital[playerid] == 4SetPlayerPos(playerid2655.7764,634.6095,14.4531);
            else if(PlayerNoHospital[playerid] == 5SetPlayerPos(playerid1608.4662,1819.7620,10.8280);
            PlayerNoHospital[playerid] = 0;
            SetPlayerArmedWeapon(playerid1);
            GivePlayerWeaponsEx(playerid, -1);
        }
        else SendClientMessage(playeridCORX1"| ERRO | Você não está perto da porta.");
        return 1;
    }
    return 
0;
}

public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(pickupid == iconesairhosp)
    {
        SetPlayerInterior(playerid0);
        //SetPlayerVirtualWorld(playerid, 0);
        if(PlayerNoHospital[playerid] == 1SetPlayerPos(playerid1176.3164,-1324.1117,14.0154);
        else if(PlayerNoHospital[playerid] == 2SetPlayerPos(playerid2032.5037,-1407.6497,17.1777);
        else if(PlayerNoHospital[playerid] == 3SetPlayerPos(playerid, -315.8423,1055.3075,19.7422);
        else if(PlayerNoHospital[playerid] == 4SetPlayerPos(playerid2655.7764,634.6095,14.4531);
        else if(PlayerNoHospital[playerid] == 5SetPlayerPos(playerid1608.4662,1819.7620,10.8280);
        PlayerNoHospital[playerid] = 0;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid1);
        GivePlayerWeaponsEx(playerid, -1);
    }

    if(pickupid == iconehosp1)
    {
        //SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid10);//1
        SetPlayerPos(playerid1175.0066,-1334.8163,9280.5693);
        PlayerNoHospital[playerid] = 1;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid0);
        ResetPlayerWeaponsEx(playerid, -1);
    }

    if(pickupid == iconehosp2)
    {
        //SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid10);
        SetPlayerPos(playerid1175.0066,-1334.8163,9280.5693);
        PlayerNoHospital[playerid] = 2;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid0);
        ResetPlayerWeaponsEx(playerid, -1);
    }

    if(pickupid == iconehosp3)
    {
        //SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid10);
        SetPlayerPos(playerid1175.0066,-1334.8163,9280.5693);
        PlayerNoHospital[playerid] = 3;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid0);
        ResetPlayerWeaponsEx(playerid, -1);
    }

    if(pickupid == iconehosp4)
    {
        //SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid10);
        SetPlayerPos(playerid1175.0066,-1334.8163,9280.5693);
        PlayerNoHospital[playerid] = 4;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid0);
        ResetPlayerWeaponsEx(playerid, -1);
    }

    if(pickupid == iconehosp5)
    {
        //SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid10);
        SetPlayerPos(playerid1175.0066,-1334.8163,9280.5693);
        PlayerNoHospital[playerid] = 5;
        SetPlayerFacingAngle(playerid90);
        SetCameraBehindPlayer(playerid);
        SetPlayerArmedWeapon(playerid0);
        ResetPlayerWeaponsEx(playerid, -1);
    }
    return 
1;




RE: Criar Pickup - LeleziiN - 08/01/2021

Alguém poderia mim ajuda pfvr


RE: Criar Pickup - LeleziiN - 08/01/2021

Bom conseguir Resolver, muito obrigado a todos que mim ajudaram