Car Pickup - 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: Car Pickup (
/showthread.php?tid=260882)
Car Pickup -
Cenation - 11.06.2011
Код:
vehicle = CreatePickup(1239, 15, 1599.2429,-1714.5852,177.4600, -1);
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup)
PutPlayerInVehicle(playerid, 411, 0);
return 1;
}
I have created this code but when player pickup that vehicle pickup player not in get car...
help me
Re: Car Pickup -
0ne - 11.06.2011
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup)
PutPlayerInVehicle(playerid, 411, 0);
return 1;
}
The code above is wrong because you are checking if a player picked up a pickupid named PICKUP which your pickup created is named vehicle.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == vehicle)
{
new Float:X,Float:Y,Float:Z,CAR[MAX_PLAYERS];
GetPlayerPos(playerid,X,Y,Z);
CAR[playerid] = CreateVehicle(411,X,Y,Z,0,0,0,-1);
PutPlayerInVehicle(CAR[playerid], 411, 0);
}
return 1;
}
That is ofc if you dont have created vehicle , if u do update the code similiar to mine and after the car is not needed delete it.
Re: Car Pickup -
Cenation - 11.06.2011
thankzz