Checkpoints
#1

Can someone tell me how checkpoints work exactly? Like I'm trying to make it so OnDialogResponse case 0: sets a checkpoint to a certain place. How do I define what THIS checkpoint does when entered, etc.. There is no "checkpoint" id or anything.
Reply
#2

Checkpoints has no "IDs". For that, you must get a checkpoint streamer. You can only place one checkpoint without a streamer.

Reply
#3

Quote:
Originally Posted by Jakku
Checkpoints has no "IDs". For that, you must get a checkpoint streamer. You can only place one checkpoint without a streamer.

Here's what I'm trying to know:

I'm making it so that when you go to a cluckin bell, you can type /order. Then, it brings up a dialog asking you what food you want to buy. There are 5 different options. 1st gives 5 health, second gives 10 health, 3rd gives 15 health, and so on. I want to make it so that if they select case 0, it will make them a checkpoint (which is located at the second window), and if they selected #1 they will get 5 health.

Reply
#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
#5

I get this error
Код:
undefined symbol: "checkpointid"
I am using Streamer PLugin!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)