Command for team, doesn't work, WHY !!!!
#1

Код:
  if(!strcmp("/poffduty",cmdtext))
  {
		new gTeam[MAX_PLAYERS];

    if(gTeam[playerid] == 1)
    {
       if(IsPlayerInRangeOfPoint(playerid, 7.0, 2295.9094,2451.3831,10.8203))
      {
       SendClientMessage(playerid,0xFFFFFFFF,"You changed to the civilian skin, and also you will be able to drive your job's car.");
       SetPlayerSkin(playerid, 185);
      }
       else
       SendClientMessage(playerid,0xFFFFFFFF,"You have to go to LVPD spawn place, to use this command");
    }
    else
       SendClientMessage(playerid,0xFFFFFFFF, " You need to be cop in order to use this command. ");
  }
  return 1;
  }
But when I went to game all it say is, '' You need to be cop in order to use this command''
So I changed the team ID over and over but not yet.

PLZ
Reply
#2

Anyone ?
Come on, Show your proffessionel, and post reply!
Reply
#3

if(!strcmp("/poffduty",cmdtext))
{
new gTeam[MAX_PLAYERS];

if(gTeam[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2295.9094,2451.3831,10.8203))
{
SendClientMessage(playerid,0xFFFFFFFF,"You changed to the civilian skin, and also you will be able to drive your job's car.");
SetPlayerSkin(playerid, 185);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,"You have to go to LVPD spawn place, to use this command");
}
}
else
SendClientMessage(playerid,0xFFFFFFFF, " You need to be cop in order to use this command. ");
}

Try?
return 1;
}
Reply
#4

pawn Код:
if(!strcmp("/poffduty",cmdtext))
  {
        new gTeam[MAX_PLAYERS]; // YOU CREATED THE VAR

    if(gTeam[playerid] == 1) // you checked it, but you didn't used it in anywhere, so how could it be 1?
    {
       if(IsPlayerInRangeOfPoint(playerid, 7.0, 2295.9094,2451.3831,10.8203))
      {
       SendClientMessage(playerid,0xFFFFFFFF,"You changed to the civilian skin, and also you will be able to drive your job's car.");
       SetPlayerSkin(playerid, 185);
      }
       else
       SendClientMessage(playerid,0xFFFFFFFF,"You have to go to LVPD spawn place, to use this command");
    }
    else
       SendClientMessage(playerid,0xFFFFFFFF, " You need to be cop in order to use this command. ");
  }
  return 1;
  }
Go wiki, learn the basics.
Reply
#5

Well, I already made the the teams.
Код:
#define TEAM_LVPD
#define TEAM_EMS
#define TEAM_FBI
#define TEAM_Military
#define TEAM_DRIVER
#define TEAM_NEW
And also

Код:
 
    SetPlayerTeamFromClass(playerid, classid)
    new gTeam[MAX_PLAYERS];
	
 	if (classid == 0)
	{
		gTeam[playerid] = 1;
  }

	if (classid == 1)
	{
		gTeam[playerid] = 2;
  }

	if (classid == 2)
	{
		gTeam[playerid] = 3 ;
  }

  if (classid == 3)
	{
		gTeam[playerid] = 4;
  }

	if (classid == 4)
	{
		gTeam[playerid] = 5;
  }
  if (classid == 5)
	{
		gTeam[playerid] = 6;
  }
but when I don't use in command function
Код:
new gTeam[MAX_PLAYERS];
It will say, undefined symbol ''gteam''
So, That's why I thought it will be okay if I use new gteam...

So what I have to do with this error ?

I need some solution!
Reply
#6

pawn Код:
#define TEAM_LVPD
#define TEAM_EMS
#define TEAM_FBI
#define TEAM_Military
#define TEAM_DRIVER
#define TEAM_NEW
pawn Код:
new gTeam[MAX_PLAYERS];
Reply
#7

Quote:
Originally Posted by MadeMan
pawn Код:
#define TEAM_LVPD
#define TEAM_EMS
#define TEAM_FBI
#define TEAM_Military
#define TEAM_DRIVER
#define TEAM_NEW
pawn Код:
new gTeam[MAX_PLAYERS];
What ?!
Reply
#8

Bump is allowed or no ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)