!help! car spawner and despawn
#1

hello everyone

this is what I want

I want to put a pickup at the hospitals where players who spawn there can get a faio or a bike
but beceuase I don't want my hole world full of bikes it would be awsome if this bike's can despawn when the player enters another vehicles or disconnect or just left it for like 1 minute

can someone help me
I am using the PPC trucking script

+ rep for the people who help me

thanks
Reply
#2

pawn Code:
new
       pTempVeh[MAX_PLAYERS],
       vTempVeh[MAX_VEHICLES],
       TempVeh;

public OnGameModeInit()
{
       TempVeh = CreatePickup(/*model, 2, x, y, z, -1*/);
       return 1;
}

public onPlayerPickupPickup(playerid, pickupid)
{
       if(pickup == TempVeh && pTempVeh[playerid] != 1)
       {
              pTempVeh[playerid] = 1;
              vTempVeh[playerid] = //AddStaticVehicle(yada yada yada...);
       }
       return 1;
}
This would be able to spawn the vehicle... just gotta think of your own way to despawn them. Look into it on the samp wiki.

Make sure you set pTempVeh[playerid] = 0; again when the vehicle despawns so they're able to get another if they so please.


ps. This is untested, and may not work. It was written directly into the topic.
Reply
#3

thanks but spawning I already find out i couldn't think of a way to despawn them
bet thanks anyway and I think I now someting now
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)