How to do I take items and store them for later use?

Started by ESGmaster, Thu 26/02/2009 18:53:02

Previous topic - Next topic

ESGmaster

As in when a player uses a airplane to move to city to city how do I have the airport customs take the players guns?

Akatosh

I recommend the LoseInventory and AddInventory functions.

Also, read the manual.

Khris

Does the player carry a variety of different guns throughout the game?

ESGmaster

Yes, the player uses many guns through out the game, aleast 4 per city with about 5 cities total.

Joe

Quote from: ESGmaster on Thu 26/02/2009 18:53:02
As in when a player uses a airplane to move to city to city how do I have the airport customs take the players guns?

But please explain what you mean, I really don't understand
Copinstar © Oficial Site

ESGmaster

As in when the player wants to go to another city (or has completed all they can do for right now.) they have their guns taken from them and stored in a chest in the airport for when they come back to that city.

Joe

#6
Ok, I think I understood you.

Let's think the roomA ir the city-A airport.

Code: ags

//roomA script

bool got=false;//we havent finished city-A

function room_Load( ){ //player enters room

  if(got==true){//if we have finished city-A another time

    player.AddInventory(iGun1);
    player.AddInventory(iGun2);
    player.AddInventory(iGun3);
    player.AddInventory(iGun4);
    //.....
  }

}

function room_Leave( ){ //player leaves room

  player.LoseInventory(iGun1);//lose all guns you want
  player.LoseInventory(iGun2);
  player.LoseInventory(iGun3);
  player.LoseInventory(iGun4);
  //.....

}

//some where in your code
got=true;//means we have finishe the city



This is not tested and you'll have to implement it in your rooms or make a module.
Copinstar © Oficial Site

SMF spam blocked by CleanTalk