SA-MP Forums Archive
Factions / Organizations - 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)
+--- Thread: Factions / Organizations (/showthread.php?tid=571358)



Factions / Organizations - NoDi522 - 18.04.2015

Hey guys. I've got one more problem. Now its about factions / organizations.

So i made enum:

PHP код:
enum pTeam
{
    
ORG_Ime,
    
ORG_Rank
};
new 
PlayerTeam[MAX_PLAYERS][pTeam]; 
...And defined some teams:

PHP код:
/* Sekcija: Define ORG */
#define Team_Civil      0
#define ORG_Bolnica     1
#define ORG_PD          2
#define ORG_News        3 
And now i made this under @OnPlayerConnect:

PHP код:
    if(pTeam[playerid][ORG_Ime] != ORG_PD);
    {
        
pTeam[playerid][ORG_Ime] = Team_Civil;
    }
    else if(
pTeam[playerid][ORG_Ime] != ORG_Bolnica);
    {
        
pTeam[playerid][ORG_Ime] = Team_Civil;
    }
    else if(
pTeam[playerid][ORG_Ime] != ORG_News);
    {
        
pTeam[playerid][ORG_Ime] = Team_Civil;
    } 
And at the end i get these errors:

PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1343) : error 028invalid subscript (not an array or too many subscripts): "pTeam"
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1343) : warning 215expression has no effect
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1343) : error 001expected token";"but found "]"
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1343) : error 029invalid expressionassumed zero
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1343) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors




Re: Factions / Organizations - ball - 18.04.2015

pTeam is an enum structure - use PlayerTeam

Код:
PlayerTeam[playerid][ORG_Ime] = Team_Civil;



Re: Factions / Organizations - NoDi522 - 18.04.2015

OMG stupid me thank you so much