Checkpoints
#4

pawn Код:
new CP1;
#define FOOD 74832

public OnGameModeInit()
{
CP1 = CreateDynamicCP(...)
return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
 if(checkpointid == CP1)
 {
 ShowPlayerDialog(playerid, FOOD, DIALOG_STYLE_LIST, "Food Shop", "Food 1\nFood 2\nFood 3", "Buy", "Cancel");
 }
 return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
 if(dialogid == FOOD && response)
 {
  switch(listitem)
  {
   case 0:
   {
   new Float:health;
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health + 25);
   SendClientMessage(playerid, COLOR_GREEN, "FOOD SHOP : You have succesfully bought Food 1");
   }
   case 1:
   {
   new Float:health;
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health + 50);
   SendClientMessage(playerid, COLOR_GREEN, "FOOD SHOP : You have succesfully bought Food 2");
   }
   case 2:
   {
   new Float:health;
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health + 75);
   SendClientMessage(playerid, COLOR_GREEN, "FOOD SHOP : You have succesfully bought Food 3");
   }
  }
}

return 1;
}
You get the idea :P
Reply


Messages In This Thread
Checkpoints - by TKZ227 - 26.05.2010, 14:35
Re: Checkpoints - by Jakku - 26.05.2010, 15:04
Re: Checkpoints - by TKZ227 - 26.05.2010, 21:52
Re: Checkpoints - by ViruZZzZ_ChiLLL - 27.05.2010, 02:20
Re: Checkpoints - by ColdXX - 27.05.2010, 14:46

Forum Jump:


Users browsing this thread: 4 Guest(s)