need help with onplayerpickuppickup
#1

hey i need t know how to sepperate the different pickuppickups

i am doing it like this

if (pickupid == cash)
{
GivePlayerMoney(playerid,500);
}
if (pickupid == cash2)
{
GivePlayerMoney(playerid,500);
}

but when i pickup 1 of them it gives me both so how do i make it so it only does the 1? im thinking i need to sepperate them somehow. thankyou!
Reply
#2

pawn Код:
if (pickupid == cash)
{
GivePlayerMoney(playerid,500);
}
else if (pickupid == cash2)
{
GivePlayerMoney(playerid,500);
}
*untested*
Reply
#3

ok so do i do that with every other one now? like this.

if (pickupid == cash)
{
GivePlayerMoney(playerid,500);
}
else if (pickupid == cash2)
{
GivePlayerMoney(playerid,500);
}
else if (pickupid == cash3)
{
GivePlayerMoney(playerid,500);
}

Reply
#4

yes but don't forget to return
pawn Код:
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)