Pickup Problem -.-
#1

Hey, I got this idea about a secret pickup somewhere in the server and when someone finds it, a new one will appear somewhere else and all the players get a hint. Well I made one pickup, works perfect, it makes a new pickup, then on that pickup I get score and a new hint, well on the THIRD pickup, everything just doesnt work =( It says the same thing as on the first pickup, it got the same Pickup ID as the first one?? Why ? How do I fix this? =(


pawn Код:
//other kinda pickups over here ^^
else if(pickupid == vulkan)
    {
    GivePlayerMoney(playerid, 50000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+50);
    SendClientMessage(playerid, red, "You have recieved 50000$ and 50 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The Volcano Pickup has been found, the next one can be found in Vinewood!");
    vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
    DestroyPickup(vulkan);

    }
    else if(pickupid == vinewood)
    {
    GivePlayerMoney(playerid, 75000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+75);
    SendClientMessage(playerid, red, "You have recieved 75000$ and 75 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The Vinewood Pickup has been found, the next one can be found in a warehouse in San Fierro!");
    DestroyPickup(vinewood); // the problem is located around here I think
    sfwarehouse = CreatePickup(1276,2,-2140.5464,-262.7972,41.5522,-1); //


    }
    else if(pickupid == sfwarehouse)
    {
    GivePlayerMoney(playerid, 100000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+100);
    SendClientMessage(playerid, red, "You have recieved 100000$ and 100 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The San Fierro Warehouse Pickup has been found, the next one can be found somewhere in the navy base!");
    DestroyPickup(sfwarehouse);
    }
    return 1;
}
Reply
#2

Try this;
pawn Код:
else if(pickupid == vulkan)
    {
        GivePlayerMoney(playerid, 50000);
        SetPlayerScore(playerid, GetPlayerScore(playerid)+50);
        SendClientMessage(playerid, red, "You have recieved 50000$ and 50 score for finding one of our secrets!");
        SendClientMessageToAll(red, "HINT: The Volcano Pickup has been found, the next one can be found in Vinewood!");
        vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
        DestroyPickup(vulkan);
    }
    else if(pickupid == vinewood)
    {
        GivePlayerMoney(playerid, 75000);
        SetPlayerScore(playerid, GetPlayerScore(playerid)+75);
        SendClientMessage(playerid, red, "You have recieved 75000$ and 75 score for finding one of our secrets!");
        SendClientMessageToAll(red, "HINT: The Vinewood Pickup has been found, the next one can be found in a warehouse in San Fierro!");
        sfwarehouse = CreatePickup(1276,2,-2140.5464,-262.7972,41.5522,-1);
        DestroyPickup(vinewood);
    }
    else if(pickupid == sfwarehouse)
    {
        GivePlayerMoney(playerid, 100000);
        SetPlayerScore(playerid, GetPlayerScore(playerid)+100);
        SendClientMessage(playerid, red, "You have recieved 100000$ and 100 score for finding one of our secrets!");
        SendClientMessageToAll(red, "HINT: The San Fierro Warehouse Pickup has been found, the next one can be found somewhere in the navy base!");
        DestroyPickup(sfwarehouse);
    }
    return 1;
}
Reply
#3

If the pickup IDs are the same, they will eventually mix eachother like a salad and confuse the script.
Eliran, you must be joking if you think identation will fix it.
Reply
#4

It doesnt work Elirian, I've already tried it...
Reply
#5

Quote:
Originally Posted by admantis
Посмотреть сообщение
If the pickup IDs are the same, they will eventually mix eachother like a salad and confuse the script.
Eliran, you must be joking if you think identation will fix it.
I wasn't fixing the identation, he destroyed the object... before he created a new one.
I though it may causes the problem...

Quote:
Originally Posted by bamby
Посмотреть сообщение
It doesnt work Elirian, I've already tried it...
Well... look what I have said to admantis, I have no idea what happened then.
Maybe he's right, you are messing with few pickups, take a look then.
Reply
#6

No all my pickup ID's are different...
Reply
#7

I can't see why.. it doesn't shows you then.

I dont know... check the coordinations again,
create a pickup without using this little game and see if it shows there.
I have no idea.
Reply
#8

It appears, but when I enter it it gives me the same Hint and score and money as in the FIRST pickup (vulkan)
Reply
#9

Mhm... can you show the whole function?
Reply
#10

pawn Код:
new vulkan;
new vinewood;
new sfwarehouse;
This on top

pawn Код:
else if(pickupid == vulkan)
    {
    GivePlayerMoney(playerid, 50000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+50);
    SendClientMessage(playerid, red, "You have recieved 50000$ and 50 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The Volcano Pickup has been found, the next one can be found in Vinewood!");
    vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
    DestroyPickup(vulkan);

    }
    else if(pickupid == vinewood)
    {
    GivePlayerMoney(playerid, 75000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+75);
    SendClientMessage(playerid, red, "You have recieved 75000$ and 75 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The Vinewood Pickup has been found, the next one can be found in a warehouse in San Fierro!");
    DestroyPickup(vinewood);
    sfwarehouse = CreatePickup(1276,2,-2140.5464,-262.7972,41.5522,-1);


    }
    else if(pickupid == sfwarehouse)
    {
    GivePlayerMoney(playerid, 100000);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+100);
    SendClientMessage(playerid, red, "You have recieved 100000$ and 100 score for finding one of our secrets!");
    SendClientMessageToAll(red, "HINT: The San Fierro Warehouse Pickup has been found, the next one can be found somewhere in the navy base!");
    DestroyPickup(sfwarehouse);
    }
    return 1;
}
And this under OnPlayerPickUpPickup
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)