Car Pickup
#1

Код:
new vehicle;
Код:
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
Reply
#2

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.
Reply
#3

thankzz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)