SA-MP Forums Archive
gteam! I need your help Please! - 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: gteam! I need your help Please! (/showthread.php?tid=138653)



gteam! I need your help Please! - samuel_hamza - 02.04.2010

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


Re: gteam! I need your help Please! - ScottCFR - 02.04.2010

May i see line 242?

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



Re: gteam! I need your help Please! - samuel_hamza - 02.04.2010

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


Re: gteam! I need your help Please! - biltong - 02.04.2010

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.


Re: gteam! I need your help Please! - samuel_hamza - 02.04.2010

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



Re: gteam! I need your help Please! - westre - 02.04.2010

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;
}



Re: gteam! I need your help Please! - samuel_hamza - 02.04.2010

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


Re: gteam! I need your help Please! - samuel_hamza - 02.04.2010

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


Re: gteam! I need your help Please! - Steven82 - 02.04.2010

You are annoying use that is why we are not replying.


Re: gteam! I need your help Please! - Bomber - 03.04.2010

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



Re: gteam! I need your help Please! - ScottCFR - 03.04.2010

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


Re: gteam! I need your help Please! - Steven82 - 03.04.2010

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



Re: gteam! I need your help Please! - samuel_hamza - 03.04.2010

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


Re: gteam! I need your help Please! - dice7 - 03.04.2010

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


Re: gteam! I need your help Please! - samuel_hamza - 03.04.2010

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

http://pastebin.com/r1mjbWe1


Re: gteam! I need your help Please! - dice7 - 03.04.2010

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


Re: gteam! I need your help Please! - samuel_hamza - 03.04.2010

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 ?


Re: gteam! I need your help Please! - samuel_hamza - 03.04.2010

Anyone!


Re: gteam! I need your help Please! - biltong - 03.04.2010

Make absolute sure you are setting gTeam properly.


Re: gteam! I need your help Please! - HrvojeCro - 19.10.2010

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!