PickUps Help
#1

Hi all,i have a probrem with pickups for example i have many pickups ,i will post tow of it to see how i am working:
PHP код:
new CrewBarEnter;
new 
CrewBarExit;
new 
SexShop1Enter;
new 
SexShop1Exit
PHP код:
CrewBarEnter CreatePickup(1272232441.1714,2065.4771,10.8203, -1);
SexShop1Enter CreatePickup(1272232085.5171,2073.9302,11.0547, -1); 
PHP код:
if(pickupid ==SexShop1Enter) {
     
SetPlayerPos(playerid,-100.0634,-23.3113,1000.7188);
    
SexShop1Exit CreatePickup(127223, -100.2415,-24.9275,1000.7188, -1);
     
SetPlayerInterior(playerid3);
     
SetPlayerVirtualWorld(playerid1);
    return 
1;
    }
    if(
pickupid ==SexShop1Exit) {
     
SetPlayerPos(playerid,2086.1890,2077.1143,11.0579);
     
SetPlayerInterior(playerid0);
     
DestroyPickup(SexShop1Exit);
     
SetPlayerVirtualWorld(playerid0);
    return 
1;
    } 
PHP код:
if(pickupid ==CrewBarEnter) {
    
SetPlayerInterior(playerid,11);
    
SetPlayerVirtualWorld(playerid1);
    
CrewBarExit CreatePickup(127223,501.7646,-67.5632,998.7578, -1);
     
SetPlayerPos(playerid,501.9742,-69.4052,998.7578);
    return 
1;
    }
    if(
pickupid ==CrewBarExit) {
    
SetPlayerInterior(playerid,0);
    
SetPlayerVirtualWorld(playerid0);
    
DestroyPickup(CrewBarExit);
     
SetPlayerPos(playerid,2443.5449,2065.0549,10.8203);
    return 
1;
    } 
The problem is that when i go to exit from crewbar i spawn to sexshop exit.Or when i go to exit from sexshop i spawn to crewbar exit.What i am doing wrong ,some helpplease,
Reply
#2

i suggest u to do /enter /exit . .
exiting/entering the shop by using a commands
Reply
#3

Ok thanks,but i want it for roleplay,and i think /enter and /exit need a lot of time to type,isn't there any aother way?
Reply
#4

i can make /enter /exit for u
or i can try to fix your script
Reply
#5

ok,thanks man,may you can try to fix it?
Reply
#6

okay
Reply
#7

pawn Код:
//** < Enter & Exit's script > **//
#include <a_samp>

new CrewBarEnter;
new CrewBarExit;
new SexShop1Enter;
new SexShop1Exit;

public OnGameModeInit()
{
    SexShop1Enter = CreatePickup(1272, 23, 2085.5171,2073.9302,11.0547, -1);
    SexShop1Exit = CreatePickup(1272, 23, -100.2415,-24.9275,1000.7188, -1);
   
    CrewBarEnter = CreatePickup(1272, 23, 2441.1714,2065.4771,10.8203, -1);
    CrewBarExit = CreatePickup(1272, 23,501.7646,-67.5632,998.7578, -1);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid ==SexShop1Enter)
    {
        SetPlayerPos(playerid,-100.0634,-23.3113,1000.7188);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 1);
    }
    else if(pickupid ==SexShop1Exit)
    {
        SetPlayerPos(playerid,2086.1890,2077.1143,11.0579);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        DestroyPickup(SexShop1Exit);
    }
    else if(pickupid ==CrewBarEnter)
    {
        SetPlayerPos(playerid,501.9742,-69.4052,998.7578);
        SetPlayerInterior(playerid,11);
        SetPlayerVirtualWorld(playerid, 1);
    }
    if(pickupid ==CrewBarExit)
    {
        SetPlayerPos(playerid,2443.5449,2065.0549,10.8203);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid, 0);
        DestroyPickup(CrewBarExit);
        return 1;
    }
    return 1;
}
your script test this if works
Reply
#8

this is enter/exit scripts with commands

pawn Код:
//** < Enter & Exit's script > **//
#include <a_samp>
#include <zcmd>

new CrewBarEnter;
new CrewBarExit;
new SexShop1Enter;
new SexShop1Exit;

public OnGameModeInit()
{
    SexShop1Enter = CreatePickup(1272, 23, 2085.5171,2073.9302,11.0547, -1);
    SexShop1Exit = CreatePickup(1272, 23, -100.2415,-24.9275,1000.7188, -1);
   
    CrewBarEnter = CreatePickup(1272, 23, 2441.1714,2065.4771,10.8203, -1);
    CrewBarExit = CreatePickup(1272, 23,501.7646,-67.5632,998.7578, -1);
    return 1;
}

CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2085.5171,2073.9302,11.0547))
    {
        SetPlayerPos(playerid,-100.0634,-23.3113,1000.7188);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 1);
    }
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2441.1714,2065.4771,10.8203))
    {
        SetPlayerPos(playerid,501.9742,-69.4052,998.7578);
        SetPlayerInterior(playerid,11);
        SetPlayerVirtualWorld(playerid, 1);
    }
    return 1;
}

CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, -100.0634,-23.3113,1000.7188))
    {
        SetPlayerPos(playerid,2085.5171,2073.9302,11.0547);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
    }
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 501.9742,-69.4052,998.7578))
    {
        SetPlayerPos(playerid,2441.1714,2065.4771,10.8203);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
   }
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid ==SexShop1Enter)
    {
        GameTextForPlayer(playerid, "/ENTER", 5000,1);
    }
    if(pickupid ==SexShop1Exit)
    {
        GameTextForPlayer(playerid, "/EXIT", 5000,1);
    }
    if(pickupid ==CrewBarEnter)
    {
        GameTextForPlayer(playerid, "/ENTER", 5000,1);
    }
    if(pickupid ==CrewBarExit)
    {
        GameTextForPlayer(playerid, "/EXIT", 5000,1);
        return 1;
    }
    return 1;
}
//>> You need ZCMD for this : https://sampforum.blast.hk/showthread.php?tid=91354 ..

Rep+ if works
Reply
#9

Ok thanks man,+1
Reply
#10

no problems and thanks for the rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)