SA-MP Forums Archive
Creating function to send to law enforcement only - 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: Creating function to send to law enforcement only (/showthread.php?tid=645689)



Creating function to send to law enforcement only - Tass007 - 02.12.2017

Hey guys. I'm getting the famous warning 213: tag mismatch warnings...

I'm not really sure how to go about it, since I don't have an OrgID to go with and only the type which is 1 for law enforcement.

Код:
(1984) : warning 213: tag mismatch
(1985) : warning 213: tag mismatch
(1988) : warning 213: tag mismatch
PHP код:
if(PlayerInfo[i][OrgID] == -1) continue; // 1984
if(oInfo[PlayerInfo[i][OrgID]][Type] == 1)  //1985
SendClientMessage(ioInfo[PlayerInfo[i][OrgID]][Color], text); //1988 
PHP код:
SendLawRadioMessage(text[])
{
    foreach(new 
i:Player)
     {
        if(
PlayerInfo[i][OrgID] == -1) continue; //If a player online isn't in an organisation it skips.
          
if(oInfo[PlayerInfo[i][OrgID]][Type] == 1//Gets the player's organization type if equal to 1 (Law) continues
        
{
            if(
GetPlayerWantedLevel(i) > 0) continue; //If player is in an Law Org but is wanted it skips them.
             
SendClientMessage(ioInfo[PlayerInfo[i][OrgID]][Color], text); //Displays the message to those that are in a law type org.
           
}
    }
    return 
1;

I hope I explained it enough for you.


Re: Creating function to send to law enforcement only - pollo97 - 02.12.2017

Can you paste the variables definition?


Re: Creating function to send to law enforcement only - Tass007 - 02.12.2017

Never mind I was being silly.