somethings is wrong with pickup[+REP]
#1

well, I working on RPG server and I made a job and secondary work of this job its to find a icon which apear random, random working but when he enter in this icon its not disapear and not give to player a item, what I did wrong?
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == parachute[0] || pickupid == parachute[1] || pickupid == parachute[2] || pickupid == parachute[3] || pickupid == parachute[4])
    {
        GivePlayerWeapon(playerid,46,1);
        return 1;
    }
    if(pickupid == clinfo && (COP[playerid] || ShitInfo[playerid][openCar] == 1)) // Casino Elevator information
    {
        GameTextForPlayer(playerid,"~g~/clift - ~w~to call lift~n~~g~/liftup - ~w~to go up~n~~g~/liftdown - ~w~to go down ~n~~g~/liftstop - ~w~to stop lift",10000,5);
    }
    if(pickupid == parkouricon[playerid])
    {
        if(GetPlayerJobID(playerid) != 10) return scm(playerid,c_r,"( ! ) This icon its not for you !");
        new rand = random(4);
        if(rand == 0)
        {
            GivePlayerMilk(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Milk in your /foodstock !");
        }
        else if(rand == 1)
        {
            GivePlayerBeer(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Beer in your /foodstock !");
        }
        else if(rand == 2)
        {
            GivePlayerFish(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Fish in your /foodstock !");
        }
        else if(rand == 3)
        {
            if(FindPlayerBagSpace(playerid) == 10) return scm(playerid,c_r,"( ! ) Your bag is full and you lost extra bonus by icon !");
            Bags[playerid][FindPlayerBagSpace(playerid)] = 1;
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Cheque +10 GCash in your bag !");
        }
        DestroyPickup(parkouricon[playerid]);
    }
    return 1;
}
note: replace give the item player receive a parachute !
Reply
#2

try this
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == parachute[0] || pickupid == parachute[1] || pickupid == parachute[2] || pickupid == parachute[3] || pickupid == parachute[4])
    {
        GivePlayerWeapon(playerid,46,1);
        return 1;
    }
    if(pickupid == clinfo && (COP[playerid] || ShitInfo[playerid][openCar] == 1)) // Casino Elevator information
    {
        GameTextForPlayer(playerid,"~g~/clift - ~w~to call lift~n~~g~/liftup - ~w~to go up~n~~g~/liftdown - ~w~to go down ~n~~g~/liftstop - ~w~to stop lift",10000,5);
    }
    if(pickupid == parkouricon[playerid])
    {
        if(GetPlayerJobID(playerid) != 10) return scm(playerid,c_r,"( ! ) This icon its not for you !");
        new rand = random(4);
        switch(rand)
        {
            case 0:
            {
            GivePlayerMilk(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Milk in your /foodstock !");
            }
            case 1:
            {
            GivePlayerBeer(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Beer in your /foodstock !");
            }
            case 2:
            {
            GivePlayerFish(playerid,1);
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Fish in your /foodstock !");
            }
            case 3:
            {
            if(FindPlayerBagSpace(playerid) == 10) return scm(playerid,c_r,"( ! ) Your bag is full and you lost extra bonus by icon !");
            Bags[playerid][FindPlayerBagSpace(playerid)] = 1;
            scm(playerid,COLOR_GREEN,"( ! ) You receive 1 Cheque +10 GCash in your bag !");
        }
        DestroyPickup(parkouricon[playerid]);
    }
    }
    return 1;
}
Reply
#3

thanks, its helped me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)