pickup issue
#6

Code:
public OnPlayerPickUpPickup(playerid, pickupid) 
{ 
    if(pickupid == gift1) 
    { 
        if(gift1 == 0) 
        { 
        gift1=1; 
        SendClientMessage(playerid,0x912334,"got it"); 
        } 
        else if(gift1 == 1) 
        { 
        SendClientMessage(playerid,0x912334,"Lool"); 
        } 
    } 
    return 1; 
}
first, you have to move it from static to dynamic. whether you need to use streamer plugin, who can be found on the internet.
Now, let's start:
Code:
    gift1 = CreatePickup(19055, 2, 1976.1938,-2380.4646,13.5469, -1);
Code:
gift1 = CreateDynamicPickup(19055, 2, 1976.1938,-2380.4646,13.5469, -1);
Code:
public OnPlayerPickUpPickup(playerid, pickupid) 
{ 
    if(pickupid == gift1) 
    { 
        if(gift1 == 0) 
        { 
        gift1=1; 
        SendClientMessage(playerid,0x912334,"got it"); 
        } 
        else if(gift1 == 1) 
        { 
        SendClientMessage(playerid,0x912334,"Lool"); 
        } 
    } 
    return 1; 
}
Code:
public OnPlayerPickUpDynamicPickup(playerid, pickupid) 
{ 
    if(pickupid == gift1) 
    { 
        if(gift1 == 0) 
        { 
        gift1=1; 
        SendClientMessage(playerid,0x912334,"got it"); 
        } 
        else if(gift1 == 1) 
        { 
        SendClientMessage(playerid,0x912334,"Lool"); 
        } 
    } 
    return 1; 
}
now, what do you want to mean from 'if(gift1 == 0)' ?
make a variable in enum pInfo(or how do you have) with name pGiftTaken for example

Code:
enum pInfo {
pGiftTaken
}
the step two, go on OnPlayerPickUpDynamicPickup:
Code:
public OnPlayerPickUpPickup(playerid, pickupid) 
{ 
    if(pickupid == gift1) 
    { 
        if(PlayerInfo[playerid][pGiftTaken] == 0) 
        { 
                PlayerInfo[playerid][pGiftTaken] = 1;
                SendClientMessage(playerid,0x912334,"got it"); 
        } 
        else if(PlayerInfo[playerid][pGiftTaken] == 1) 
        { 
               SendClientMessage(playerid,0x912334,"Lool");
        } 
    } 
    return 1; 
}
and now you can make this variable saveable(mysql or what you want)
this may fix your problem
Reply


Messages In This Thread
pickup issue - by bugmenotlol - 02.12.2016, 14:57
Re: whats wrong :( - by Dayrion - 02.12.2016, 14:59
Re: whats wrong :( - by SyS - 02.12.2016, 15:01
Re: whats wrong :( - by bugmenotlol - 02.12.2016, 15:06
Re: whats wrong :( - by Vince - 02.12.2016, 15:10
Re: whats wrong :( - by ImTouchk - 02.12.2016, 15:16
Re: whats wrong :( - by ISmokezU - 02.12.2016, 18:55
Re: whats wrong :( - by ImTouchk - 06.12.2016, 08:15
Re: pickup issue - by Threshold - 06.12.2016, 09:59
Re: pickup issue - by Kar - 06.12.2016, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)