Pickup Problem
#1

So I got this idea of a secret pickup in my server, and when you enter it, a new one appear with a hint... Well what happends is when I enter the first pickup, it gives me the hint to the new location and everything works fine, but the new pikcup somehow got the SAME pickup id as the old one?? ЁI have defined everything (new vulkan; vulkan = CreateObject(bla bla bla); )


Код:
	
//All the other pickups is 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 our treasure");
	SendClientMessageToAll(red, "HINT: The Volcano Pickup has been found, the next one can be found in      Vinewood!");
	DestroyPickup(vulkan);
	vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
	}
	else if(pickupid == vinewood)
 	{
	GivePlayerMoney(playerid, 75000);
	SetPlayerScore(playerid, GetPlayerScore(playerid)+75);
	SendClientMessage(playerid, red, "You have recieved 75000$ and 75 score for finding our treasure");
	SendClientMessageToAll(red, "HINT: The Vinewood Pickup has been found, the next one can be found in a warehouse in San Fierro!");
	DestroyPickup(vinewood);
	}
    return 1;
}
So when i enter "vulkan" pikcup it does the things that I want it too, then I create the new pickup, and when i enter "vinewood" it does the same thing as in "vulkan" (it tells me the same) and it doesnt Detroy the pickup or anything! >.<

If anyone can help me I would be happy

Thank you!
Reply
#2

Quote:
Originally Posted by bamby
Посмотреть сообщение
So I got this idea of a secret pickup in my server, and when you enter it, a new one appear with a hint... Well what happends is when I enter the first pickup, it gives me the hint to the new location and everything works fine, but the new pikcup somehow got the SAME pickup id as the old one?? ЁI have defined everything (new vulkan; vulkan = CreateObject(bla bla bla); )


Код:
	
//All the other pickups is 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 our treasure");
	SendClientMessageToAll(red, "HINT: The Volcano Pickup has been found, the next one can be found in      Vinewood!");
	DestroyPickup(vulkan);
	vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
	}
	else if(pickupid == vinewood)
 	{
	GivePlayerMoney(playerid, 75000);
	SetPlayerScore(playerid, GetPlayerScore(playerid)+75);
	SendClientMessage(playerid, red, "You have recieved 75000$ and 75 score for finding our treasure");
	SendClientMessageToAll(red, "HINT: The Vinewood Pickup has been found, the next one can be found in a warehouse in San Fierro!");
	DestroyPickup(vinewood);
	}
    return 1;
}
So when i enter "vulkan" pikcup it does the things that I want it too, then I create the new pickup, and when i enter "vinewood" it does the same thing as in "vulkan" (it tells me the same) and it doesnt Detroy the pickup or anything! >.<

If anyone can help me I would be happy

Thank you!
I think you need to change this two lines in order:
DestroyPickup(vulkan);
vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);

Try making them like this:
vinewood = CreatePickup(1276,2,1378.1597,-807.1733,85.0415,-1);
DestroyPickup(vulkan);


Cause I think that when you destroy it, a free pickupid gets available, and you create a new pickup that uses the destroyed pickup's id.. :P
Reply
#3

Yay ^__^ it worked! Thank you so much =)

Edit: -.-

It worked for the second one, but I added a third one and it does the same as the first one again >.< What now? =(
Reply
#4

Second page bump =o
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)