StaR-GaMinG
Would you like to react to this message? Create an account in a few clicks or log in to continue.

StaR-GaMinG

Welcome to StriKe-ShoT!
 
HomeHome  SearchSearch  Latest imagesLatest images  Chat  RegisterRegister  Log inLog in  

 

 [Tutorial] Anti-Reclama

Go down 
AuthorMessage
AuD_CuLoRi

AuD_CuLoRi


Mesaje Mesaje : 121
Inscris In Inscris In : 2011-03-15

[Tutorial] Anti-Reclama Empty
PostSubject: [Tutorial] Anti-Reclama   [Tutorial] Anti-Reclama EmptySat Mar 19, 2011 3:36 pm

Cauta:
Quote :
public OnPlayerText

1. Aici adaugi asta:
Quote :
//////////////////
// * Anti * //
// * Reclama * //
/////////////////
if(GoIP(text))
{
new reclama[MAX_PLAYER_NAME];
GetPlayerName(playerid, reclama, sizeof(reclama));
format(string, sizeof(string), "[Server]: %s was banned, reason: Reclama",reclama);
SendClientMessageToAll(0xFF6347AA,string);
SendClientMessage(playerid, 0xFF0000FF, "[ENG]:You have banned , because you write an IP Adrees.");
SendClientMessage(playerid, 0xFF0000FF, "[RO]:Tu ai fost bannad pentru ca ai scris o adresa IP.");
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
BanLog(string);
return 1;
}

2. La sfarsitul GM-ului adaugati:
Quote :
GoIP(StrToChk[])
{
new IpLevel = 0;
for(new a = 0; a < strlen(StrToChk); a++)
{

switch(IpLevel)
{
case 0:
{
if(IsNum(StrToChk[a])) IpLevel++;
}
case 1, 2:
{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 4;
else IpLevel = 0;
}
case 3:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 4:
{
if(IsNum(StrToChk[a])) IpLevel++;
else IpLevel = 0;
}
case 5, 6:
{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 8;
else IpLevel = 0;
}
case 7:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 8:
{
if(IsNum(StrToChk[a])) IpLevel++;
else IpLevel = 0;
}
case 9, 10:{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 12;
else IpLevel = 0;
}
case 11:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 12:
{
if(IsNum(StrToChk[a])) return 1;
else IpLevel = 0;
}
}
}
return 0;
}

IsNum(textchar)
{
if(textchar == '0') return 1;
if(textchar == '1') return 1;
if(textchar == '2') return 1;
if(textchar == '3') return 1;
if(textchar == '4') return 1;
if(textchar == '5') return 1;
if(textchar == '6') return 1;
if(textchar == '7') return 1;
if(textchar == '8') return 1;
if(textchar == '9') return 1;
return 0;
}

3. Iar acum pentru ca anti-reclama sa mearga si la celelalte chaturi [ /o /a /n /f /news ...etc]

Adaugati la fiecare chat asta:
Quote :
if(GoIP(result))
{
new reclama[MAX_PLAYER_NAME];
GetPlayerName(playerid, reclama, sizeof(reclama));
format(string, sizeof(string), "[Server]: %s was banned, reason: Reclama",reclama);
SendClientMessageToAll(0xFF6347AA,string);
SendClientMessage(playerid, 0xFF0000FF, "[ENG]:You have banned , because you write an IP Adrees.");
SendClientMessage(playerid, 0xFF0000FF, "[RO]:Tu ai fost bannad pentru ca ai scris o adresa IP.");
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
BanLog(string);
return 1;
}
Back to top Go down
https://stargaming.forumgratuit.ro
 
[Tutorial] Anti-Reclama
Back to top 
Page 1 of 1
 Similar topics
-
» Tutorial Lag
» [TUTORIAL]Cum sa creezi un HQ.
» Tutorial Downloadat De Pe Youtube
» Creare Factiuni Noi [Tutorial]
»  Tutorial implementare xFire in jocul Counter-Strike 1.6 sau alte jocuri non steam

Permissions in this forum:You cannot reply to topics in this forum
StaR-GaMinG :: Strike - Shot | Sa:Mp :: Tutoriale-
Jump to: