Why is pickup not working?
#1

Hey i tried creating a pickup

Код:
Pickup[18] = CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
and here's when you try to touch it.

Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
	   pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])
	{
	    if(InP[playerid] == 5)
	    {
	        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
	        GivePlayerCash(playerid, 4000);
	        format(str, sizeof(str), "[Parkour]: %s(%d) has finished the Major Parkour!", GetName(playerid), playerid);
	        SendClientMessageToAll(COLOR_LIME, str);
	        SendClientMessage(playerid, COLOR_YELLOW, "[Finished]: You finished the Major Parkour, Received $4,000 + 5 score!");
	        GameTextForPlayer(playerid, "~w~Major Parkour ~g~Finished~n~~n~~w~Reward: ~g~$4,000 ~w~+ ~g~5+ ~w~score", 6500, 3);
			if(God[playerid][1] == 0)
			{
			    TextDrawHideForPlayer(playerid, Textdraw4);
			    TextDrawShowForPlayer(playerid, Textdraw5);
			    AC_BS_SetPlayerHealth(playerid, 99.0);
			    AC_BS_SetPlayerArmour(playerid, 100.0);
			}
			SpawnPlayer(playerid);
			InP[playerid] = 0;
		}
	    else if(InP[playerid] <= 5)
	    {
			SendClientMessage(playerid, COLOR_RED, "[Error]: You are not Parkouring, You cheat, You cannot get the reward!");
		}
	}
When i touch it nothing happens at all. But it's there i can see the arrow. Can anyone tell me what is causing this?.
Reply
#2

I don't think
pawn Код:
new Pickup[18]; //is correct
//Try making them all
new Pickup1;
new Pickup2;
//etc...
try and come back
Reply
#3

Lol dude this is wrong,if you are using new Pickup[18]; then you have to create them all not only once ..

Код:
Pickup[0]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
Pickup[1]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
Pickup[2]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
//etc etc to 18..
and change your to this

Код:
       if(pickupid == Pickup[5] || pickupid == Pickup[6] || 
          pickupid == Pickup[7] || pickupid == Pickup[8] || 
          pickupid == Pickup[9] || pickupid == Pickup[10] || 
          pickupid == Pickup[11] || pickupid == Pickup[12] || 
          pickupid == Pickup[13] || pickupid == Pickup[14] || 
          pickupid == Pickup[15] || pickupid == Pickup[16] || 
          pickupid == Pickup[17] || pickupid == Pickup[18])
         {
Reply
#4

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
Lol dude this is wrong,if you are using new Pickup[18]; then you have to create them all not only once ..

Код:
Pickup[0]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
Pickup[1]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
Pickup[2]= CreatePickup(1318, 1, 157.63,-1946.05,100.67, 1149);
//etc etc to 18..
and change your to this

Код:
       if(pickupid == Pickup[5] || pickupid == Pickup[6] || 
          pickupid == Pickup[7] || pickupid == Pickup[8] || 
          pickupid == Pickup[9] || pickupid == Pickup[10] || 
          pickupid == Pickup[11] || pickupid == Pickup[12] || 
          pickupid == Pickup[13] || pickupid == Pickup[14] || 
          pickupid == Pickup[15] || pickupid == Pickup[16] || 
          pickupid == Pickup[17] || pickupid == Pickup[18])
         {
I have the other pickups created i just showed you the one that is not working.
Reply
#5

Try putting a 'SendClientMessage();' under the if-statement to see if you're actually picking up the pickup.

pawn Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
       pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])        if(pickupid == Pickup[18])
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You've picked up the pickup!");
Reply
#6

Ok sorry then try to fix urself look at your

Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
	   pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])        THIS - remove it if(pickupid == Pickup[18])
Reply
#7

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
Ok sorry then try to fix urself look at your

Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
	   pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])        THIS - remove it if(pickupid == Pickup[18])
I don't know where the if before the pickup [18] came from this it how it really looks.

Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
	   pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])
Reply
#8

try what I said
Reply
#9

Quote:
Originally Posted by Vanter
Посмотреть сообщение
try what I said
I got already defined "pickup"
Plus the only not working pickup is pickup 18. The rest work good and they don't have new pickup for all of them.
Reply
#10

pawn Код:
if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
       pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17] || pickupid == Pickup[18])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)