SA-MP Forums Archive
Dynamic pickup [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: Dynamic pickup [HELP] (/showthread.php?tid=603527)



Dynamic pickup [HELP] - MRM - 24.03.2016

Hi,
I have two entrances door from two locations.
SetPlayerPos both one locations.
And
I have two exit door from one locations.
SetPlayerPos is two places.

When I get out from both. PizEx is its location.
I tried to fix this problem with MAX_SHOP and MAX_PLAYERS. But it not fix.
Sry, My English is not so good.

Thanks .

Example:
Код:
new PizEn[MAX_SHOP][MAX_PLAYERS];
new PizEx[MAX_SHOP][MAX_PLAYERS];
new PizzaCEn[MAX_SHOP][MAX_PLAYERS];
new PizzaCEx[MAX_SHOP][MAX_PLAYERS];
new PizGEn[MAX_SHOP][MAX_PLAYERS];
new PizGEx[MAX_SHOP][MAX_PLAYERS];

(OnPlayerConnect)
PizEn[1][playerid] =    CreateDynamicPickup(1559,1,x,y,z,-1,-1,-1,100);
PizEx[1][playerid] =    CreateDynamicPickup(1559,1,22,22,22,-1,-1,-1,100); // ===

PizzaCEn[2][playerid] = CreateDynamicPickup(1559,1,x,y,z,-1,-1,-1,50);
PizzaCEx[2][playerid] = CreateDynamicPickup(1559,1,22,22,22,-1,-1,-1,100); // ===

PizGEn[3][playerid] =   CreateDynamicPickup(1559,1,x,y,z,-1,-1,-1,100);
PizGEx[3][playerid] =   CreateDynamicPickup(1559,1,x,y,z,-1,-1,-1,100);
	
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
	if(pickupid == PizEn[1][playerid]) // ===
	{
	    SetPlayerInterior(playerid,5);
	    SetPlayerPos(playerid,33,33,33);
	    SetPlayerFacingAngle(playerid,0);
	    SetCameraBehindPlayer(playerid);
	}
	if(pickupid == PizEx[1][playerid])
	{
	    SetPlayerInterior(playerid,0);
	    SetPlayerPos(playerid,x,y,z);
	    SetPlayerFacingAngle(playerid,225);
	    SetCameraBehindPlayer(playerid);
	}
		if(pickupid == PizzaCEn[2][playerid]) // ===
	{
	    SetPlayerInterior(playerid,5);
	    SetPlayerPos(playerid,33,33,33);
	    SetPlayerFacingAngle(playerid,0);
	    SetCameraBehindPlayer(playerid);
	}
	if(pickupid == PizzaCEx[2][playerid])
	{
	    SetPlayerInterior(playerid,0);
	    SetPlayerPos(playerid,x,y,z);
	    SetPlayerFacingAngle(playerid,225);
	    SetCameraBehindPlayer(playerid);
	}
    if(pickupid == PizGEn[3][playerid])
	{
	    SetPlayerInterior(playerid,17);
	    SetPlayerPos(playerid,x,y,z);
	    SetPlayerFacingAngle(playerid,0);
	    SetCameraBehindPlayer(playerid);
	}
	if(pickupid == PizGEx[3][playerid])
	{
	    SetPlayerInterior(playerid,0);
	    SetPlayerPos(playerid,x,y,z);
	    SetPlayerFacingAngle(playerid,225);
	    SetCameraBehindPlayer(playerid);
	}
	return 1;
}



Re: Dynamic pickup [HELP] - Vince - 24.03.2016

Pickups don't have player variants so if a pickup is visible for one player it is visible for all players. Also I have no idea what you're actually trying to achieve.


Re: Dynamic pickup [HELP] - MRM - 24.03.2016

How to get last pickup?
Example: GetPlayerLastPickup

Or is there another way to recognize there is a pickup?


Re: Dynamic pickup [HELP] - zPain - 24.03.2016

PHP код:
new gPlayerLastPickup[MAX_PLAYERS];

public 
OnPlayerPickUpDynamicPickup(playeridpickupid) {
    
// code

    
gPlayerLastPickup[playerid] = pickupid;
    return 
1;
}

stock GetPlayerLastPickup(playerid) {
    return 
gPlayerLastPickup[playerid];




Re: Dynamic pickup [HELP] - MRM - 24.03.2016

Edit: (I need to get last pickup player entrances it.)


Re: Dynamic pickup [HELP] - MRM - 25.03.2016

Up ...