SA-MP Forums Archive
Locking two teams with clan tag - 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: Locking two teams with clan tag (/showthread.php?tid=604689)



Locking two teams with clan tag - RuvExArisa - 08.04.2016

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.


Re: Locking two teams with clan tag - Jelly23 - 08.04.2016

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



Re: Locking two teams with clan tag - RuvExArisa - 08.04.2016

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


Re: Locking two teams with clan tag - Jelly23 - 08.04.2016

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


Re: Locking two teams with clan tag - RuvExArisa - 08.04.2016

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


Re: Locking two teams with clan tag - RuvExArisa - 08.04.2016

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


Re: Locking two teams with clan tag - Vanter - 08.04.2016

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;




Re: Locking two teams with clan tag - RuvExArisa - 08.04.2016

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.