SA-MP Forums Archive
Checkpoints problem - 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 problem (/showthread.php?tid=88975)



Checkpoints problem - Takumi.WS - 30.07.2009

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
  if(streamid == copcp)
  {
	 SendClientMessage(playerid,COLOR_YELLOW, "[ ! ] To get your cop job, type /getcop ");
	 }
	if(streamid == hitmancp)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your hitman job, type /gethitman");
	}
	if(streamid == mechaniccp)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your mechanic job, type /getmechanic");
	}
		if(streamid == mediccp)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your medic job, type /getmedic");
	}
		if(streamid == thiefcp)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your thief job, type /getthief");
	}
  return 1;
}
but when i enter 1 checkpoint
it shows :

[ ! ] To get your cop job, type /getcop
[ ! ] To get your hitman job, type /gethitman
[ ! ] To get your mechanic job, type /getmechanic
[ ! ] To get your medic job, type /getmedic
[ ! ] To get your thief job, type /getthief

Can anyone tell me why ?


Re: Checkpoints problem - StrickenKid - 30.07.2009

Try using switch, its less messy:

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
	switch(streamid)
	{
		case copcp: SendClientMessage(playerid,COLOR_YELLOW, "[ ! ] To get your cop job, type /getcop ");
		case hitmancp: SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your hitman job, type /gethitman");
		case mechaniccp: SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your mechanic job, type /getmechanic");
		case mediccp: SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your medic job, type /getmedic");
		case thiefcp: SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] To get your thief job, type /getthief");
	}
	return 1;
}



Re: Checkpoints problem - Joe Staff - 30.07.2009

Probably because you did something like

pawn Код:
#define copcp 1
#define hitmancp 1
#define mechaniccp 1
#define mediccp 1
#define thiefcp 1
when it should be

pawn Код:
#define copcp 1
#define hitmancp 2
#define mechaniccp 3
#define mediccp 4
#define thiefcp 5