SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=586383)



Help - Edw - 21.08.2015

Hello. I noticed that this "protection" only go to the first clan to clan but not otherwise. Could you please help me?

PHP код:
    new Cachedb mysql_query(mysql"SELECT * FROM `clans`"); 
    
GetPlayerName(playeridszNamesizeof(szName));
    for(new 
icache_get_row_count (); != j; ++i)
    {
        
cache_get_field_content(i"ID"szString); strval(szString);
        if(
strfind(szNameClanInfo[x][cTag], true) != -|| strfind(ClanInfo[x][cTag], szNametrue) != -1) {
            
SendClientMessage(playeridCOLOR_RED"Your name contains clan tag so you get a kick!");
            
SetTimerEx("KickPlayer"10000"d"playerid);
        }
        return 
1;
    }
    
cache_delete(db); 



Re: Help - Edw - 21.08.2015

Help me?


Re: Help - jamal1992 - 21.08.2015

ce vrei sa faci ca nu inteleg ?


Re: Help - Edw - 21.08.2015

Quote:
Originally Posted by jamal1992
Посмотреть сообщение
ce vrei sa faci ca nu inteleg ?
Am adaugat o protectie ca playerii sa nu-si poata pune nume care contin tag-uri iar aceasta functioneaza doar la primu clan, atat.


Re: Help - jamal1992 - 21.08.2015

Scoate return ala de acolo ca opreste loop-ul. Si apropo ms pt idee uitasem de aceasta restrictie )


Re: Help - jamal1992 - 21.08.2015

Sau poti pune asa:
Код:
if(strfind(szName, ClanInfo[x][cTag], true) != -1 || strfind(ClanInfo[x][cTag], szName, true) != -1)
{ 
            SendClientMessage(playerid, COLOR_RED, "Your name contains clan tag so you get a kick!"); 
            SetTimerEx("KickPlayer", 1000, 0, "d", playerid);
            return 1; // sau break;
 }