SA-MP Forums Archive
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: Pickup help (/showthread.php?tid=346907)



Pickup help - boyan96 - 30.05.2012

How i can create pickup and when i go to the pickup and press SCROLL ( KEY_LOOK_BEHIND) to setplayerpos somewhere


Re: Pickup help - ViniBorn - 30.05.2012

Use OnPlayerPickUpPickup/IsPlayerInRangeOfPoint + GetPlayerKeys


Re: Pickup help - boyan96 - 30.05.2012

but when i make it on public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

i have this error error : error 030: compound statement not closed at the end of file (started at line 481)

PHP код:
[PHP]if(newkeys KEY_LOOK_BEHIND)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.01434.90002441,-1456.40002441,20.60000038))
         {
        if(
pickupid == pickup55)
    {
    
SetPlayerInterior(playerid7);
    
SetPlayerPos(playerid,302.292877,-143.139099,1004.062500);
        return 
1;
        }
     return 
1;

[/PHP]


Re: Pickup help - [LvZ]Free - 30.05.2012

AAAA WTF ?!

Why You open two "{" and closing three ?
and why two are three "return 1;" ?


Re: Pickup help - ViniBorn - 30.05.2012

pawn Код:
if(newkeys & KEY_LOOK_BEHIND)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1434.90002441,-1456.40002441,20.60000038))
    {
        SetPlayerInterior(playerid, 7);
        SetPlayerPos(playerid,302.292877,-143.139099,1004.062500);
    }
    return 1;
}



Re: Pickup help - boyan96 - 30.05.2012

again error 030: compound statement not closed at the end of file (started at line 481)


Re: Pickup help - Azazelo - 30.05.2012

how look you line 481 ?


Re: Pickup help - boyan96 - 30.05.2012

PHP код:
new PickupTest
public 
OnGameModeInIt()
 {
PickupTest CreatePickup(1239232044.2612,-1487.2828,10.8281, -1); 
return 
1;
    }
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == PickupTest
                 
SetPlayerPos(playerid1723.0146,-1878.4855,13.5646);
                 
SetPlayerFacingAngle(playerid359.2945);
         return 
1;
    }
    return 
1;

How i can make this to enter with SCROLL


Re: Pickup help - ViniBorn - 30.05.2012

Replace
pawn Код:
public OnGameModeInit()
{
    PickupTest = CreatePickup(1239, 23, 2044.2612,-1487.2828,10.8281, -1);
    return true;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == PickupTest)
    {
        SetPlayerPos(playerid, 1723.0146,-1878.4855,13.5646);
        SetPlayerFacingAngle(playerid, 359.2945);
    }
    return true;
}



Re: Pickup help - boyan96 - 30.05.2012

yes but i wont when i press SCROLL to
SetPlayerPos(playerid, 1723.0146,-1878.4855,13.5646);
SetPlayerFacingAngle(playerid, 359.2945);