30.05.2012, 15:56
How i can create pickup and when i go to the pickup and press SCROLL ( KEY_LOOK_BEHIND) to setplayerpos somewhere
[PHP]if(newkeys & KEY_LOOK_BEHIND)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1434.90002441,-1456.40002441,20.60000038))
{
if(pickupid == pickup55)
{
SetPlayerInterior(playerid, 7);
SetPlayerPos(playerid,302.292877,-143.139099,1004.062500);
return 1;
}
return 1;
}
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;
}
new PickupTest;
public OnGameModeInIt()
{
PickupTest = CreatePickup(1239, 23, 2044.2612,-1487.2828,10.8281, -1);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == PickupTest)
SetPlayerPos(playerid, 1723.0146,-1878.4855,13.5646);
SetPlayerFacingAngle(playerid, 359.2945);
return 1;
}
return 1;
}
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;
}