Help converting OnPlayerPickUpDynamicPickup to OnPlayerKeyStateChange
#1

Hello there,

I currently have a shop system and I would like to change it so instead of having to walk into the pickup to enter the store, you could press the [F] button to enter it.

My current code is

Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    new arr[2];
    Streamer_GetArrayData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, arr);
    if(arr[0] == ENEX_STREAMER_IDENTIFIER)
    {
        if((gettime() - DelayTick[playerid]) < 3)
            return 1;

        if(pickupid == storeData[arr[1]][entCP])
        {
            DelayTick[playerid] = gettime();

            SetPlayerVirtualWorld(playerid, storeData[arr[1]][virtualID]);
            SetPlayerInterior(playerid, storeData[arr[1]][interiorID]);

            SetPlayerPos(playerid, storeData[arr[1]][extPos][0], storeData[arr[1]][extPos][1], storeData[arr[1]][extPos][2]);
            SetPlayerFacingAngle(playerid, storeData[arr[1]][extPos][3]);
            SetCameraBehindPlayer(playerid);
        }
        if(pickupid == storeData[arr[1]][extCP])
        {
            DelayTick[playerid] = gettime();

            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);

            SetPlayerPos(playerid, storeData[arr[1]][entPos][0], storeData[arr[1]][entPos][1], storeData[arr[1]][entPos][2]);
            SetPlayerFacingAngle(playerid, storeData[arr[1]][entPos][3]);
            SetCameraBehindPlayer(playerid);
        }
    }
	return true;
}
Help would be appreciated
Reply


Messages In This Thread
Help converting OnPlayerPickUpDynamicPickup to OnPlayerKeyStateChange - by FunnyBear - 04.04.2016, 12:42
Re: Help converting OnPlayerPickUpDynamicPickup to OnPlayerKeyStateChange - by Dignity - 04.04.2016, 13:17
Re: Help converting OnPlayerPickUpDynamicPickup to OnPlayerKeyStateChange - by FunnyBear - 04.04.2016, 13:20

Forum Jump:


Users browsing this thread: 1 Guest(s)