Jump to content
  • 0

Problema machine


Rayan

Question

Am incercat sa modific locatia unde sa se execute OnPlayerUseVendinMachine, insa nu merge, ca sa folosesc dozatorul trebuie sa fiu in el practic, nu in fata lui. Am incercat sa sterg si IsPlayerInDynamicArea insa tot nu merge. trebuie sa fiu practic in locul unde el pozitionat X,Y,Z, nu in fata lui.

Folosesc include-ul vending.inc

Cum pot rezolva?

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_SECONDARY_ATTACK) && (GetPlayerAnimationIndex(playerid) != 1660))
    {
        for(new i; i < MAX_MACHINES; i++)
        {
            if(!IsValidVendingMachine(i))
                continue;
	            #if defined Streamer_IncludeFileVersion
            if(!IsPlayerInDynamicArea(playerid, g_eVendingData[i][E_VENDING_AREA]))
                continue;
            #else
            new Float:x, Float:y;
            GetXYInFrontOfVending(i, x, y, 0.5);
            if(!IsPlayerInRangeOfPoint(playerid, 1, 1552.5898, -1683.4698, 13.5504))
                continue;
            #endif
	            SetPlayerFacingAngle(playerid, g_eVendingData[i][E_VENDING_RZ]);
            if(OnPlayerUseVendingMachine(playerid, i) != 0)
            {
                if(g_eVendingData[i][E_VENDING_TYPE] == MACHINE_SNACK) {
                    ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0, 1);
                    PlayerPlaySound(playerid, 42601, 0.0, 0.0, 0.0);
                }
                else {
                    ApplyAnimation(playerid, "VENDING", "VEND_USE", 3.0, 0, 0, 0, 0, 0, 1);
                    PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
                    SetTimerEx("OnAnimationDrink", 1800, false, "i", playerid);
                }
	                #if !defined NO_SPRUNK_ACTION
                if(g_eVendingData[i][E_VENDING_TYPE] == MACHINE_SPRUNK) SetTimerEx("ven_SetPlayerAnimation", 2500, false, "i", playerid);
                #endif
            }
            else ClearAnimations(playerid);
        }
    }
    #if !defined NO_SPRUNK_ACTION
    else if((newkeys & KEY_FIRE) && g_eLastDrink[playerid] < GetTickCount() && (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK))
    {
        OnPlayerDrinkSprunk(playerid);
        g_eLastDrink[playerid] = GetTickCount() + 2350;
    }
    #endif
    #if defined inc_Ven_OnPlayerKeyStateChange
        return inc_Ven_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
    #else
        return 0;
    #endif
}

Edited by Rayan
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)

 

ai incercat sa maresti raza la    if(!IsPlayerInRangeOfPoint(playerid, 1, 1552.5898, -1683.4698, 13.5504))  ??

in loc de 1 sa pui de ex 5?

 

 

Edited by 97fresh
 

 

430x73_FFFFFF_FF9900_000000_000000.png

 
Link to comment
Share on other sites

  • 0
Acum 4 ore, 97fresh a spus:

IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)

 

ai incercat sa maresti raza la    if(!IsPlayerInRangeOfPoint(playerid, 1, 1552.5898, -1683.4698, 13.5504))  ??

in loc de 1 sa pui de ex 5?

 

 

Da, am pus ei 30 si degeaba. trebuie sa fi in dozator la propriu ca sa functioneze

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.