Checkpoints - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoints (
/showthread.php?tid=150488)
Checkpoints -
TKZ227 - 26.05.2010
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.
Re: Checkpoints -
Jakku - 26.05.2010
Checkpoints has no "IDs". For that, you must get a checkpoint streamer. You can only place one checkpoint without a streamer.
Re: Checkpoints -
TKZ227 - 26.05.2010
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.
Re: Checkpoints -
ViruZZzZ_ChiLLL - 27.05.2010
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
Re: Checkpoints -
ColdXX - 27.05.2010
I get this error
Код:
undefined symbol: "checkpointid"
I am using Streamer PLugin!!