Checkpoints problem
#1

Код:
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 ?
Reply
#2

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;
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)