need [HELP]
#1

hi all ,, i want make a pickup , when you come on that pickup with car you get teleported ,, i was trying like this

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{ 
  if(pickupid == alsp)
	{
	if (IsPlayerInAnyVehicle(playerid))
	{
	SetPlayerPos(playerid, 1298.6200,391.5222,-14.4206);
	}
	return 1;
	}
return 1;
}
but it doesnt work ,
and i was trying like this:

Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,1322.1727,397.4924,19.5547))
	{
    if (IsPlayerInAnyVehicle(playerid))
	{
	SetPlayerPos(playerid, 1298.6200,391.5222,-14.4206);
	}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1292.8981,376.8788,-14.4161))
	{
    if (IsPlayerInAnyVehicle(playerid))
	{
	SetPlayerPos(playerid, 1309.3567,403.0032,19.5547);
	}
	}
return 1;
}
and when im come i get teleported but car stay ,, only me gat teleported

somebody can help please
Reply
#2

Use SetVehiclePos(GetPlayerVehicleID(playerid), .... ) for this, it sets the position of the car of the player.
Also not all pickup types can be picked up with a car, check the wiki for a detailled list what type you have to use.
Reply
#3

can you give me example please
Reply
#4

https://sampwiki.blast.hk/wiki/Pickup_help
pick a types which is pickupable in a vehicle from the list at the bottom for your CreatePickup.

Example with SetVehiclePos:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == alsp)
    {
    if (IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), 1298.6200,391.5222,-14.4206);
    }
    return 1;
    }
return 1;
}
Reply
#5

its doenst work aggain ,, maybe i need oter pickup , im using pickup ID 1314 ,, i need change pickup or something other?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)