SA-MP Forums Archive
CreateDynamicPickUp help - 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)
+--- Thread: CreateDynamicPickUp help (/showthread.php?tid=553926)



CreateDynamicPickUp help - dan40o - 01.01.2015

OnGameModeInit:
Код:
pickup19 = CreateDynamicPickup(1274, 3, 363.5612,-2060.9463,15.3972, 0);
bagwitmoney = CreateDynamicPickup(1550, 3, 972.4592, -2356.1089, 91.6249, 0);
OnPlayerPickupDynamicPickUp:
Код:
if(pickupid == pickup19)
	{
		GivePlayerMoney(playerid, 2500);
		DestroyDynamicPickup(pickup19);
	}
	if(pickupid == bagwitmoney)
	{
		GivePlayerMoney(playerid, 150000);
		DestroyDynamicPickup(bagwitmoney);
	}
It doesn't work. I can't see the pickup. How can i make it when player pickup PickUp to give him money and to destroy the pickup?


Re: CreateDynamicPickUp help - nezo2001 - 01.01.2015

On the top of the script
PHP код:
new pickup19;
new 
bagwitmoney
Rep if i helped you


Re: CreateDynamicPickUp help - dan40o - 01.01.2015

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
On the top of the script
PHP код:
new pickup19;
new 
bagwitmoney
Rep if i helped you
ofc. I have these variables, if i don't how can i compile the whole code.


Re: CreateDynamicPickUp help - nezo2001 - 01.01.2015

Ooh sorry try this
PHP код:
if(pickupid == pickup19)
    {
        
GivePlayerMoney(playerid2500);
        
DestroyDynamicPickup(pickup19);
    }
    else if(
pickupid == bagwitmoney)
    {
        
GivePlayerMoney(playerid150000);
        
DestroyDynamicPickup(bagwitmoney);
    } 



Re: CreateDynamicPickUp help - dan40o - 01.01.2015

I already tried this. It doesn't work.


Re: CreateDynamicPickUp help - nezo2001 - 01.01.2015

Try this

PHP код:
pickup19 CreatePickup(12743363.5612,-2060.9463,15.39720);
bagwitmoney CreatePickup(15503972.4592, -2356.108991.62490); 
And this
PHP код:
if(pickupid == pickup19
    { 
        
GivePlayerMoney(playerid2500); 
        
DestroyDynamicPickup(pickup19); 
    } 
    else if(
pickupid == bagwitmoney
    { 
        
GivePlayerMoney(playerid150000); 
        
DestroyDynamicPickup(bagwitmoney); 
    } 
Both at the same time


Re: CreateDynamicPickUp help - nezo2001 - 01.01.2015

Try this

PHP код:
pickup19 CreatePickup(12743363.5612,-2060.9463,15.39720);
bagwitmoney CreatePickup(15503972.4592, -2356.108991.62490); 
And this
PHP код:
if(pickupid == pickup19
    { 
        
GivePlayerMoney(playerid2500); 
        
DestroyPickup(pickup19); 
    } 
    else if(
pickupid == bagwitmoney
    { 
        
GivePlayerMoney(playerid150000); 
        
DestroyPickup(bagwitmoney); 
    } 
Both at the same time


Re: CreateDynamicPickUp help - dan40o - 01.01.2015

When i pickup it nothing happens.


Re: CreateDynamicPickUp help - Schneider - 01.01.2015

I tested your code, but it works fine for me... The pickups show up and they give me money when i pick them up.

Are you sure you have added the plugin to your server.cfg?


Re: CreateDynamicPickUp help - dan40o - 01.01.2015

ofcourse.
plugins crashdetect Whirlpool sscanf streamer