Bank Pickup Help
#1

Need a Small Help !
When i Enter a Pickup it does not shows any Dialogue response i have 2 banks now and want to create more but this pickups are making issues

here is th codes :
Код:
new pInfo[MAX_PLAYERS][PLAYER_MAIN];
new GetinBank;
new GetinBan;
new GetoutBan;
new GetoutBank;

GetinBank = CreatePickup(1318, 1, 1481.283813, -1770.431152, 18.795755, 0);
GetoutBank = CreatePickup(1318, 1, 2304.675537, -16.035686, 26.742187, 0);
GetinBan = CreatePickup(1318, 1, 2181.1257,2295.1389,10.8203, 0);
GetoutBan = CreatePickup(1318, 1,2304.675537, -16.035686, 26.742187, 0);


public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == GetinBank)
{
GetoutBank = CreatePickup(1318, 1, 2304.675537, -16.035686, 26.742187, 0);
DestroyPickup(GetoutBan);
SetPlayerPos(playerid,2313,-4, 27);
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
SetCameraBehindPlayer(playerid);
return 1;
}
if(pickupid == GetinBan)
{
GetoutBan = CreatePickup(1318, 1, 2304.675537, -16.035686, 26.742187, 0);
DestroyPickup(GetoutBank);
SetPlayerPos(playerid,2313,-4, 27);
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
SetCameraBehindPlayer(playerid);
return 1;
}
if(pickupid == GetoutBan)
{
SetPlayerPos(playerid,2177.2295,2294.1592,10.8125);
SetPlayerFacingAngle(playerid,0.0);
SetCameraBehindPlayer(playerid);
return 1;
}
if(pickupid == GetoutBank)
{
SetPlayerPos(playerid,1481.130371,-1763.401000, 18.795755);
SetPlayerFacingAngle(playerid,0.0);
SetCameraBehindPlayer(playerid);
return 1;
}
return 1;
}
thnx in advance
Reply
#2

1) You don't really need all of those vars, and you only need one exit var.
PHP код:
new pInfo[MAX_PLAYERS][PLAYER_MAIN];
new 
BankEnt[2], BankExt;
BankEnt[0] = CreatePickup(131811481.283813, -1770.43115218.795755, -1); // Bank 1
BankEnt[1] = CreatePickup(131812181.1257,2295.1389,10.8203, -1); // Bank 1
BankExt CreatePickup(131812304.675537, -16.03568626.742187, -1); // One pick up.
public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(
pickupid == BankEnt[0])
    {
        
SetPlayerVirtualWorld(playerid1); // Putting them in virtual worlds.. WILL come in handy!
        
SetPlayerPos(playerid2313, -427);
        
SetCameraBehindPlayer(playerid);
        
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
        return 
1;
    }
    if(
pickupid == BankEnt[1])
    {
        
SetPlayerVirtualWorld(playerid2); // Putting them in virtual worlds.. WILL come in handy!
        
SetPlayerPos(playerid2313, -427);
        
SetCameraBehindPlayer(playerid);
        
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
        return 
1;
    }
    
    if(
pickupid == BankExt)
    {
        if(
GetPlayerVirtualWorld(playerid) == 1)  // Getting their virtual world and spawning them at their respected location
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerPos(playerid,1481.130371, -1763.40100018.795755);
            
SetPlayerFacingAngle(playerid0.0);
            
SetCameraBehindPlayer(playerid);
        }
        else if(
GetPlayerVirtualWorld(playerid) == 2)   // Getting their virtual world and spawning them at their respected location
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerPos(playerid2177.22952294.159210.8125);
            
SetPlayerFacingAngle(playerid,0.0);
            
SetCameraBehindPlayer(playerid);
        }
        
// else if(...)
    
}
    return 
1;

And you just have to place them into virtual worlds for future banks, and edit the exit one.
If the coords don't match up correctly then switch them around because I got confused lol.

As for the dialogs, you're sending a message.
You'll have to post the command for this dialog.
Reply
#3

Quote:
Originally Posted by itsCody
Посмотреть сообщение
1) You don't really need all of those vars, and you only need one exit var.
PHP код:
new pInfo[MAX_PLAYERS][PLAYER_MAIN];
new 
BankEnt[2], BankExt;
BankEnt[0] = CreatePickup(131811481.283813, -1770.43115218.795755, -1); // Bank 1
BankEnt[1] = CreatePickup(131812181.1257,2295.1389,10.8203, -1); // Bank 1
BankExt CreatePickup(131812304.675537, -16.03568626.742187, -1); // One pick up.
public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(
pickupid == BankEnt[0])
    {
        
SetPlayerVirtualWorld(playerid1); // Putting them in virtual worlds.. WILL come in handy!
        
SetPlayerPos(playerid2313, -427);
        
SetCameraBehindPlayer(playerid);
        
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
        return 
1;
    }
    if(
pickupid == BankEnt[1])
    {
        
SetPlayerVirtualWorld(playerid2); // Putting them in virtual worlds.. WILL come in handy!
        
SetPlayerPos(playerid2313, -427);
        
SetCameraBehindPlayer(playerid);
        
SendClientMessage(playerid,COLOR_YELLOW,"/Bank to view the Bank Menu");
        return 
1;
    }
    
    if(
pickupid == BankExt)
    {
        if(
GetPlayerVirtualWorld(playerid) == 1)  // Getting their virtual world and spawning them at their respected location
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerPos(playerid,1481.130371, -1763.40100018.795755);
            
SetPlayerFacingAngle(playerid0.0);
            
SetCameraBehindPlayer(playerid);
        }
        else if(
GetPlayerVirtualWorld(playerid) == 2)   // Getting their virtual world and spawning them at their respected location
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerPos(playerid2177.22952294.159210.8125);
            
SetPlayerFacingAngle(playerid,0.0);
            
SetCameraBehindPlayer(playerid);
        }
        
// else if(...)
    
}
    return 
1;

And you just have to place them into virtual worlds for future banks, and edit the exit one.
If the coords don't match up correctly then switch them around because I got confused lol.

As for the dialogs, you're sending a message.
You'll have to post the command for this dialog.
Thnx it Works !
(rep++)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)