spawn menu
#3

Quote:
Originally Posted by jpboy1
Посмотреть сообщение
can anyone help me please i am a noob in pawno scripting!
1. putting player in seat

pawn Код:
new temp_veh;
temp_veh = AddStaticVehicle(etc...)
PutPlayerInVehicle(playerid,temp_veh,0); //temp_veh is the vehicle ID, and 0 is the driver's seat
2. saving the car ID when its created, and destroy when the player steps out

Add this on declarations:
pawn Код:
IsVehicleCreatedForPlayer[MAX_PLAYERS];
Add this onplayerspawn:
pawn Код:
IsVehicleCreatedForPlayer[playerid] = -1; //setting the value standard on -1 (so not created for player)
This on the dialog when the player gets an vehicle:
pawn Код:
IsVehicleCreatedForPlayer[playerid] = temp_veh; //assigning the car ID
And finally... this on OnPlayerStateChange (not on playerkeystatechange!)
pawn Код:
if (IsVehicleCreatedForPlayer[playerid] >-1) //if its not -1, so an spawned vehicle (assigned with the id)
    {
        if (oldstate == PLAYER_STATE_DRIVER)
        {
            DestroyVehicle(IsVehicleCreatedForPlayer[playerid]); //destroying the car
                              IsVehicleCreatedForPlayer[playerid] = -1; //resetting state
        }
    }
Reply


Messages In This Thread
spawn menu - by jpboy1 - 30.08.2010, 19:57
Re: spawn menu - by jpboy1 - 30.08.2010, 20:18
Re: spawn menu - by gamer931215 - 30.08.2010, 20:27
Re: spawn menu - by jpboy1 - 30.08.2010, 21:11

Forum Jump:


Users browsing this thread: 1 Guest(s)