SA-MP Forums Archive
Pickup Problem -.- - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pickup Problem -.- (/showthread.php?tid=212045)



Pickup Problem -.- - bamby - 16.01.2011

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;
}



Re: Pickup Problem -.- - Toreno - 16.01.2011

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;
}



Re: Pickup Problem -.- - admantis - 16.01.2011

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.


Re: Pickup Problem -.- - bamby - 16.01.2011

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


Re: Pickup Problem -.- - Toreno - 16.01.2011

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.


Re: Pickup Problem -.- - bamby - 16.01.2011

No all my pickup ID's are different...


Re: Pickup Problem -.- - Toreno - 16.01.2011

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.


Re: Pickup Problem -.- - bamby - 16.01.2011

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


Re: Pickup Problem -.- - Toreno - 16.01.2011

Mhm... can you show the whole function?


Re: Pickup Problem -.- - bamby - 16.01.2011

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