13.08.2011, 20:11
I have teams set out, I need to make it so that if they were to do a command, it would work, but if another team tried to do it, it would say "You need to be in the Police Force to use this command." help?
//in case you used AddPlayerClassEx
new teamid = GetPlayerTeam(playerid);
if(teamid == 1/2)//whatever
{
if (strcmp("/command", cmdtext, true, 10) == 0)
{
if(PlayerTeam[playerid] == TEAM1) {
//code here
}
else if(PlayerTeam[playerid] == TEAM2) {
SendClientMessage(playerid,COLOR_WHITE,"SERVER: "COL_RED"You are not TEAM1 to use this command");
return 1;
}
return 1;
}
new TEAM_POLICE;
if (strcmp("/enter", cmdtext, true) == 0) { if(IsPlayerInRangeOfPoint(playerid, 2.0, 1469.3627,-1010.8922,26.8438)) { SetPlayerPos(playerid, 246.2732,112.0255,1003.2188); SetPlayerInterior(playerid, 10); } if(PlayerTeam[playerid] == TEAM_POLICE) { if(IsPlayerInRangeOfPoint(playerid, 2.0, 239.9734,117.2457,1003.2257)) { SetPlayerPos(playerid, 237.9738,117.6887,1003.2188); } } else if(PlayerTeam[playerid] == TEAM_GROVE) { SendClientMessage(playerid,COLOR_WHITE,"SERVER: You have to be in the Police Force to enter here."); return 1; } return 1; }
C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(164) : error 017: undefined symbol "PlayerTeam" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(164) : warning 215: expression has no effect C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(164) : error 001: expected token: ";", but found "]" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(164) : error 029: invalid expression, assumed zero C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(164) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if(PlayerTeam[playerid] == TEAM_POLICE) {
C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(49) : error 017: undefined symbol "MAX_LYERSap" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(49) : error 009: invalid array size (negative, zero or out of bounds) C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(190) : warning 209: function "OnPlayerCommandText" should return a value C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(192) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(194) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(199) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(203) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(207) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(211) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(215) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(218) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 017: undefined symbol "PlayerInfo" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : warning 215: expression has no effect C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 001: expected token: ";", but found "]" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 029: invalid expression, assumed zero C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(190) : warning 209: function "OnPlayerCommandText" should return a value C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(192) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(194) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(199) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(203) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(207) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(211) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(215) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(218) : error 010: invalid function or declaration C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 017: undefined symbol "PlayerInfo" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : warning 215: expression has no effect C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 001: expected token: ";", but found "]" C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : error 029: invalid expression, assumed zero C:\Users\System user\Desktop\Server\gamemodes\Robert.pwn(226) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 12 Errors.