need [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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need [HELP] (
/showthread.php?tid=241773)
need [HELP] with pickup -
Amel_PAtomAXx - 18.03.2011
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
Re: need [HELP] -
Mauzen - 18.03.2011
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.
Re: need [HELP] -
Amel_PAtomAXx - 18.03.2011
can you give me example please
Re: need [HELP] -
Mauzen - 19.03.2011
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;
}
Re: need [HELP] -
Amel_PAtomAXx - 19.03.2011
its doenst work aggain ,, maybe i need oter pickup , im using pickup ID 1314 ,, i need change pickup or something other?