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=479617)



PickUp Help... - AryanV - 06.12.2013

How To Create Such Sort Of a Pickup That When a Player Touches It He Gets a Vehicle...


Re: PickUp Help... - Tayab - 06.12.2013

Here are the following links you wanna goto and look.

https://sampwiki.blast.hk/wiki/CreatePickup
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
https://sampwiki.blast.hk/wiki/CreateVehicle

And here is the sample code created where you can learn from.

Remember to change the x,y and z to where you want the pickup.

pawn Код:
new pickup;
public OnGameModeInit()
{
   pickup = CreatePickup(1247,1,x,y,z,0);
   return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
   if(pickupid == pickup)
   {
       new Float:Pos[4];
       GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2];
       GetPlayerFacingAngle(playerid,Pos[3]);
       CreateVehicle(560,Pos[0],Pos[1],Pos[2],Pos[3],random(225),random(225),60);
   }
   return 1;
}