SA-MP Forums Archive
how to create a condition? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to create a condition? (/showthread.php?tid=133350)



how to create a condition? - _S_ - 11.03.2010

is it a code anti-advertising in PM ? But does this code work at the commands of /register and /login . Exemple: /login 12345 -> mute
And it badly, because it is not possible to be registered and login.

public OnPlayerCommandText(playerid, cmdtext[])
{


new string[256];
for(new i;i < strlen(cmdtext);i++)
{
new a[2],c=0;
for(new j = 0;j < strlen(cmdtext);j++)
{
strmid(a,cmdtext,i+j,i+j+1,2);
if('0' <= a[0] <= '9')c+=1;
}
if(c == 5)
{
MutePM[playerid] = 1;
mutepmtime[playerid] = 180;
SendClientMessage(playerid, 0xFFFFFFAA, " Reklama ");
SendClientMessage(playerid, 0xFFFFFFAA, " Chat off");
format(string,sizeof(string)," Warning %s tried to send text in PM: %s",oGetPlayerName(playerid), cmdtext);
ABroadCast(COLOR_YELLOW,string,1);
return 0;
}
}
=========================

how to create a condition that on the commands of /register and /login anti advertising malfunctioned?


Re: how to create a condition? - _S_ - 12.03.2010

prompt me please


Re: how to create a condition? - pen_theGun - 12.03.2010

put this function below the register function.


Re: how to create a condition? - _S_ - 12.03.2010

why? this function needs me. Simply that malfunctioned on the commands of /register and /login