Put Player In Vehicle Problem / DestroyVehicle Timer
#1

pawn Код:
case 3: //Get My Truck
    {
    new pTruck;
        TruckType[playerid] = dini_Int(udb_encode(PlayerName), "TruckType");
        pTruck = AddStaticVehicle(TruckType[playerid],-79.0896,-1127.8126,0.9531,66,-1,-1);
        TogglePlayerControllable(playerid,1);
        PutPlayerInVehicle(playerid,pTruck,0);
        SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You Have Retrieved Your Truck.");
    }
This code only seems to send the message but the vehicle doesnt actually spawn. It is an option on a menu thats why is case 3:
It should spawn the vehicle id thats in the file.
Reply
#2

Код:
pTruck = AddStaticVehicle(TruckType[playerid],-79.0896,-1127.8126,0.9531,66,-1,-1);
Quote:
Originally Posted by Wiki
This function can only create vehicles in the OnGameModeInit callback, and vehicles created with this function cannot be removed. Check CreateVehicle if you are interested in creating vehicles during game-runtime.
Reply
#3

Yeah use CreateVehicle. The parameters are different though so you'll have to adjust the line.
Reply
#4

OK this is fine for geting into the vehicle but i dont want a respawn delay. So how do I DestroyVehicle when you have been out the pTruck for a minute or two. Do i need a timer somewhere?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)