problem with pickups
#1

Hello all,
i got the problem with pickups
i will first post my code and then explain it
so here's the code
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
 for(new i; i < MAX_ENTERS; i++) {
    if(Enters[i] == pickupid) {
            GameTextForPlayer(playerid, "~g~/enter~g~ to enter", 2000, 3);
    }
    if(Exits[i] == pickupid) {
            GameTextForPlayer(playerid, "~g~/exit~g~ to exit", 2000, 3);
    }
 }
 for(new b; b < MAX_BANK; b++) {
    if(Banks[b] == pickupid) {
            GameTextForPlayer(playerid, "/balance /deposit /withdraw /transfer", 2000, 3);
    }
 }
    return 1;
}


in my gamemode init i have this:
    LoadEnters();
    LoadBankP();

at the top of my script:

enum EnterInfo {
    Pickup1,
    Pickup2,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:TeleX,
    Float:TeleY,
    Float:TeleZ,
    Interior,
    vw,
    bool:Official
}
new Enter[MAX_ENTERS][EnterInfo] = {
{1275, 1318, -176.4418, 1112.0864, 19.7422, 207.5793, -110.6434, 1005.1328, 15, 1, true}, //binco
{1318, 1318, -207.7078, 1119.1892, 20.4297, 390.2964, 173.7713, 1008.3828, 3, 2, true}, //townhall
{1274, 1318, -179.5288, 1133.0720, 19.7422, 2305.2292, -16.1469, 26.7422, 0, 3, true} //bank
};

new Enters[MAX_ENTERS];
new Exits[MAX_ENTERS];

enum BankInfo {
    Float:bPosX,
    Float:bPosY,
    Float:bPosZ
}

new Bank[MAX_BANK][BankInfo] = {
{2316.5, -12.5389, 26.7422},
{2316.5, -9.8624, 26.7422},
{2316.5, -7.3837, 26.7422},
{2316.5, -15.5140, 26.7422}
};

new Banks[MAX_BANK];
stock LoadBankP() {
    for(new i; i < MAX_BANK; i++) {
        Banks[i] = CreateDynamicPickup(1239, 1, Bank[i][bPosX], Bank[i][bPosY], Bank[i][bPosZ], -1, 0, -1, 100);
    }
}

stock LoadEnters() {
    for(new i; i < MAX_ENTERS; i++) {
        Enters[i] = CreateDynamicPickup(Enter[i][Pickup1], 1, Enter[i][PosX], Enter[i][PosY], Enter[i][PosZ], 0, 0, -1, 40.0);
        Exits[i] = CreateDynamicPickup(Enter[i][Pickup2], 1, Enter[i][TeleX], Enter[i][TeleY], Enter[i][TeleZ], Enter[i][vw], Enter[i][Interior], -1, 40.0);
    }
}

and at the top:
#define MAX_ENTERS 3
#define MAX_BANK 4
so the pickups work, they are at the right position and i can do
/enter & /exit
but when i enter the bankpickups
it also says "/enter to enter" or "/exit to exit"
it doesn't say /balance /withdraw /deposit /transfer
so that's the weird thing
can anyone help me please?
thanks
Reply
#2

nobody can help me? =p
Reply
#3

Give us the '/enter' Command
Reply
#4

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Give us the '/enter' Command
why?
/enter works perfectly..
the problem is the gametext on playerpickup
Reply
#5

try this way
pawn Код:
for(new i; i < MAX_ENTERS; i++) {
    if(pickupid ==Enters[i]) {
            GameTextForPlayer(playerid, "~g~/enter~g~ to enter", 2000, 3);
    }
    if(pickupid ==Exits[i]) {
            GameTextForPlayer(playerid, "~g~/exit~g~ to exit", 2000, 3);
    }
 }
and
pawn Код:
if(pickupid == Banks[b])
Reply
#6

Quote:
Originally Posted by Crystyan12
Посмотреть сообщение
try this way
pawn Код:
for(new i; i < MAX_ENTERS; i++) {
    if(pickupid ==Enters[i]) {
            GameTextForPlayer(playerid, "~g~/enter~g~ to enter", 2000, 3);
    }
    if(pickupid ==Exits[i]) {
            GameTextForPlayer(playerid, "~g~/exit~g~ to exit", 2000, 3);
    }
 }
and
pawn Код:
if(pickupid == Banks[b])
nope found the answer.. XD
because i use streamer, i had to use the callback:
OnPlayerPickUpDynamicPickup(playerid, pickupid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)