Locking two teams with clan tag
#1

Okay so I'm having a bit of a problem locking two teams for a specific clan tag. So far I was able to lock one of them by using this code below:

Код:
public OnPlayerRequestSpawn(playerid)
{
	new
	    name[MAX_PLAYER_NAME]
 	;
 	GetPlayerName(playerid, name, sizeof(name));
 	if(gTeam[playerid] == TEAM_Cali) {
 	    if (strfind(name, "GwE_", true) == 0) {
	        return 1;
		}
		else {
		    GameTextForPlayer(playerid, "~r~You're not a member of Gang War Elites", 3000, 1);
		    ForceClassSelection(playerid);
		    return 0;
		}
	}
	return 1;
}


Now the problem is, I am trying to lock another team with using the same code I guess but it does not work. How do I lock another team? Please help me I would gladly rep+ you.
Reply
#2

try this:

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(gTeam[playerid] == TEAM_Cali)
        {
          if (strfind(name, "GwE_", true) == 0)
              {
                return 1;
          }
          else
              }
            GameTextForPlayer(playerid, "~r~You're not a member of Gang War Elites", 3000, 1);
            ForceClassSelection(playerid);
            return 0;
          }
    }
        else if(gTeam[playerid] == YOUR TEAM HERE)
        {
              if(strfind(name,"TAG HERE",true) == 0)
              {
                    return 1;
              }
              else
              {
                      GameTextForPlayer(playerid, "~r~You're not a member of TEAM NAME HERE", 3000, 1);
              ForceClassSelection(playerid);
              return 0;
          }
    }
    return 1;
}
Reply
#3

C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(332 : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3330) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3332) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3334) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(333 : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3341) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3322) : error 029: invalid expression, assumed zero
Reply
#4

Quote:
Originally Posted by RuvExArisa
Посмотреть сообщение
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(332 : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3330) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3332) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3334) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(333 : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3341) : error 010: invalid function or declaration
C:\Users\*****\Desktop\Cust. Pawno\GWDMv2.pwn(3322) : error 029: invalid expression, assumed zero
change YOUR TEAM NAME.. etc with yours
Reply
#5

It's the lines in the first code you posted where the errors are.
Reply
#6

Quote:
Originally Posted by Jelly23
Посмотреть сообщение
change YOUR TEAM NAME.. etc with yours
I did that and still same errors.
Reply
#7

PHP код:
public OnPlayerRequestSpawn(playerid)
{
    new
        
name[MAX_PLAYER_NAME]
     ;
     
GetPlayerName(playeridnamesizeof(name));
     if(
gTeam[playerid] == TEAM_Cali || gTeam[playerid] == TEAM_WTV u want//edit here
 
{
         if (
strfind(name"GwE_"true) == 0) {
            return 
1;
        }
        else {
            
GameTextForPlayer(playerid"~r~You're not a member of Gang War Elites"30001);
            
ForceClassSelection(playerid);
            return 
0;
        }
    }
    return 
1;

Reply
#8

Quote:
Originally Posted by Vanter
Посмотреть сообщение
PHP код:
public OnPlayerRequestSpawn(playerid)
{
    new
        
name[MAX_PLAYER_NAME]
     ;
     
GetPlayerName(playeridnamesizeof(name));
     if(
gTeam[playerid] == TEAM_Cali || gTeam[playerid] == TEAM_WTV u want//edit here
 
{
         if (
strfind(name"GwE_"true) == 0) {
            return 
1;
        }
        else {
            
GameTextForPlayer(playerid"~r~You're not a member of Gang War Elites"30001);
            
ForceClassSelection(playerid);
            return 
0;
        }
    }
    return 
1;

Wouldn't that lock 2 teams with the same clan tag? I'm trying to lock two teams with 2 different clan tags not with 1 clan tag for both teams.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)