gteam! I need your help Please!
#1

Well, all I did in 5 days ago is searching, yeah, searching, not only in sa-mp but also in ******.
I got fucked up in my GM, but made it back.
All I need is exlplanation, PLZ, I will make my question clear, and please make your answer too.

Ok, let's start.
I already defined the team
Код:
#define TEAM_LVPD 0
#define TEAM_EMS 1
#define TEAM_FBI 2
#define TEAM_Military 3
#define TEAM_DRIVER 4
#define TEAM_NEW 5
#define TEAM_LVPD_COLOR 0x33CCFFAA
#define TEAM_EMS_COLOR 0xFF9900AA
#define TEAM_FBI_COLOR 0xFFFFFFAA
#define TEAM_Military_COLOR 0x7CFC00AA
#define TEAM_DRIVER_COLOR 0x660000AA
then I did this function
Код:
new gTeam[MAX_PLAYERS];
And I did SetPlayerFromClass
Код:
forward SetPlayerTeamFromClass(playerid,classid);
public SetPlayerTeamFromClass(playerid, classid);

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

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

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

  else if (classid == 3)
	{
		gTeam[playerid] = 3;
		return 1;
	}

	else if (classid == 4)
	{
		gTeam[playerid] = 4;
		return 1;
  }

  else if (classid == 5)
	{
		gTeam[playerid] = 5;
		return 1;
  }
As everyone said.
When I want to make command like this

Код:
if(!strcmp("/poffduty",cmdtext))
  {  
    if(gTeam[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 4.0, 2295.9094,2451.3831,10.8203))
	  {
    SetPlayerSkin(playerid, 185);
    SendClientMessage(playerid,0xFFFFFFFF,"Bla Bla Bla");
    }
    else
    SendClientMessage(playerid,0xFFFFFFFF, " Bla Bla Bla ");
    return 1;
  }
  return 0;
}
I get errors and warnings
Код:
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 017: undefined symbol "gTeam"
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : warning 215: expression has no effect
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 001: expected token: ";", but found "]"
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 029: invalid expression, assumed zero
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : fatal error 107: too many error messages on one line
Please, Don't be lazy, HELP HELP and HELP
Reply
#2

May i see line 242?

Код:
static gTeam[MAX_PLAYERS]; //gTeam define
Reply
#3

Quote:
Originally Posted by ScottCFR
May i see line 242?

Код:
static gTeam[MAX_PLAYERS]; //gTeam define
The line 242 is

Код:
if(!strcmp("/poffduty",cmdtext))
  {  
    if(gTeam[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 4.0, 2295.9094,2451.3831,10.8203)) // This is line 242
	  {
    SetPlayerSkin(playerid, 185);
    SendClientMessage(playerid,0xFFFFFFFF,"Bla Bla Bla");
    }
    else
    SendClientMessage(playerid,0xFFFFFFFF, " Bla Bla Bla ");
    return 1;
  }
  return 0;
}
Well about static, I already made it into command function.
But this command works for each team, not the Team 0

Please, Help here
Reply
#4

gTeam should be static, AND it MUST be at the top of your script where all your includes and defines are. That's the only reason I can think of why you're getting that error.
Reply
#5

I did that.

Код:
#define TEAM_LVPD 0
#define TEAM_EMS 1
#define TEAM_FBI 2
#define TEAM_Military 3
#define TEAM_DRIVER 4
#define TEAM_NEW 5
#define TEAM_LVPD_COLOR 0x33CCFFAA
#define TEAM_EMS_COLOR 0xFF9900AA
#define TEAM_FBI_COLOR 0xFFFFFFAA
#define TEAM_Military_COLOR 0x7CFC00AA
#define TEAM_DRIVER_COLOR 0x660000AA

static gTeam[MAX_PLAYERS];
But nothing happen.
Код:
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 017: undefined symbol "gTeam"
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : warning 215: expression has no effect
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 001: expected token: ";", but found "]"
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : error 029: invalid expression, assumed zero
C:\Users\hamza & yassine\Desktop\LV-RP\Gamemodes\LV-RP.pwn(242) : fatal error 107: too many error messages on one line
Reply
#6

pawn Код:
if(!strcmp("/poffduty",cmdtext))
{  
    if(gTeam[playerid] == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 4.0, 2295.9094,2451.3831,10.8203)) // This is line 242
        {
            SetPlayerSkin(playerid, 185);
            SendClientMessage(playerid,0xFFFFFFFF,"TRUE");
        }
        else
        {    
            SendClientMessage(playerid,0xFFFFFFFF, "FALSE");
        }
    }
    return 1;
}
Reply
#7

LOL, same errors and warning.
The problem is ''undefined gteam" though I defined it.
WTF!
Everyone use this system gteam.
And they can't tell me
Reply
#8

Come on, take a loot at it, and tell me what's wrong!
Don't be lazy!
Please
Reply
#9

You are annoying use that is why we are not replying.
Reply
#10

WTF is that ? This is tottaly wrong
pawn Код:
static gTeam[MAX_PLAYERS];
Just add
pawn Код:
new gTeam[MAX_PLAYERS];
Reply
#11

Quote:
Originally Posted by Bomba' Xtreme'Stuntage
WTF is that ? This is tottaly wrong
pawn Код:
static gTeam[MAX_PLAYERS];
Just add
pawn Код:
new gTeam[MAX_PLAYERS];
That's how i put it on my server, Works fine
Reply
#12

Same here..you only need..yeah we figured it out xD
Код:
new gTeam[MAX_PLAYERS];
Reply
#13

Read my first post, I did already
Код:
new gTeam[MAX_PLAYERS];
But I got those errors and warning, come on!
Think, check, test or whatever, just Help me, thanks
Reply
#14

Quote:
Originally Posted by ScottCFR
Quote:
Originally Posted by Bomba' Xtreme'Stuntage
WTF is that ? This is tottaly wrong
pawn Код:
static gTeam[MAX_PLAYERS];
Just add
pawn Код:
new gTeam[MAX_PLAYERS];
That's how i put it on my server, Works fine
When you see something new, you could first educate yourself a little to see what it does, then test it on your own server and then post here and not spread false information and confuse new scripters even more


And OP, post all of your code on pastebin.com
Reply
#15

I said I test'd it already, and got same errors, and anyways, I post'd all my code, here

http://pastebin.com/r1mjbWe1
Reply
#16

Delete the #if defined FILTERSCRIPT and #else lines from yours script. Because you aren't defining it as a filterscript, the compiler doesn't process the code beneath #if defined FILTERSCRIPT. Like I said, just delete it
Reply
#17

Well, thanks, I don't get those errors anymore
but when I'm done in compiling, and playing in the server, it works in each team not gteam 0

Код:
  if(!strcmp("/poffduty",cmdtext))
  {
     if(gTeam[playerid] == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2295.9094,2451.3831,10.8203)) // This is line 242
	      {
            SetPlayerSkin(playerid, 185);
            SendClientMessage(playerid,0xFFFFFFFF,"You have been changed to civilian skin.");
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFF, "You have to be in LVPD spawn place in order to use this command!");
        }
    }
     else
    {
            SendClientMessage(playerid,0xFFFFFFFF, "You have to be cop in order to use this command!");
    }
     return 1;
  }
  return 0;
}
Damn, why ?
Reply
#18

Anyone!
Reply
#19

Make absolute sure you are setting gTeam properly.
Reply
#20

Quote:
Originally Posted by dice7
Посмотреть сообщение
Delete the #if defined FILTERSCRIPT and #else lines from yours script. Because you aren't defining it as a filterscript, the compiler doesn't process the code beneath #if defined FILTERSCRIPT. Like I said, just delete it
That is correct answer! NO errors no anithyng!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)