Wysłany: 2014-04-13, 17:04
PvF.GreeN
Wiek: 28 Na forum: 4672 dni Posty: 209
Nick w MP: NexuS
Piwa : 2875
W og?le si? to nie wykonuje tak jak powinno..
Pawn
#include a_samp
public OnPlayerText ( playerid , text [])
{
new str [ 128 ];
GetPVarString ( playerid , "ASPAM" , str , 128 );
if( str [ 0 ] != '{TEXT}' && ! strcmp ( text , str , false ))
{
new lol = GetTickCount ();
new x = GetPVarInt ( playerid , "ASPAMCOUNT" );
if( x >= 2 , GetTickCount () - lol < 5000 )
{
SendClientMessage ( playerid ,- 1 , "* {A40000}Chwilowo zablokowano Ci mo?liwo?? pisania, odczekaj {FF7777}5 {A40000}sekund!" );
}
else
{
SCM ( playerid , - 1 , "* {A40000}Nie spam tym samym tekstem na czacie!" );
SetPVarInt ( playerid , "ASPAMCOUNT" , x + 1 );
}
}
else
SetPVarInt ( playerid , "ASPAMCOUNT" , 0 );
SetPVarString ( playerid , "ASPAM" , text );
return 0 ;
}
Mia?o to dzia?a? tak, ?e jak napisze 2 razy to samo na czacie pokazuje mi
Kod:
* {A40000}Nie spam tym samym tekstem na czacie!
za 3 razem to..
Kod: * {A40000}Chwilowo zablokowano Ci mo?liwo?? pisania, odczekaj {FF7777}5 {A40000}sekund!
A mi si? ca?y czas wykonuje to co mia?o si? wykona? za 3 razem + nie blokuje pisania na czacie na 5 sek..
Wysłany: 2014-04-13, 21:58
Michalec
Dokładnie.
Wiek: 30 Na forum: 6405 dni Posty: 163
Nick w MP: []Damianos[]
Piwa : 99
Pawn public OnPlayerText ( playerid , text [])
{
new str [ 128 ];
if( gettime () < GetPVarInt ( playerid , "ASPAMTIME" ) && GetPVarInt ( playerid , "ASPAMCOUNT" ) == 2 )
{
format ( str , 128 , "* {A40000}Chwilowo zablokowano Ci mo?liwo?? pisania, odczekaj {FF7777}%d {A40000}sekund!" , GetPVarInt ( playerid , "ASPAMTIME" ) - gettime ());
return SendClientMessage ( playerid ,- 1 , str ), 0 ;
}
GetPVarString ( playerid , "ASPAM" , str , 128 );
if(! strcmp ( text , str , false ) && gettime () - GetPVarInt ( playerid , "ASPAMTIME" ) < 5 )
{
SetPVarInt ( playerid , "ASPAMCOUNT" , GetPVarInt ( playerid , "ASPAMCOUNT" ) + 1 );
switch( GetPVarInt ( playerid , "ASPAMCOUNT" ))
{
case 1 : return SendClientMessage ( playerid , - 1 , "* {A40000}Nie spam tym samym tekstem na czacie!" ), 0 ;
case 2 : return SetPVarInt ( playerid , "ASPAMTIME" , gettime ()+ 5 ), SendClientMessage ( playerid ,- 1 , "* {A40000}Chwilowo zablokowano Ci mo?liwo?? pisania, odczekaj {FF7777}5 {A40000}sekund!" ), 0 ;
}
}
SetPVarInt ( playerid , "ASPAMTIME" , gettime ());
SetPVarInt ( playerid , "ASPAMCOUNT" , 0 );
SetPVarString ( playerid , "ASPAM" , text );
return 1 ;
}
Prosz?.
Tagi: anty :: spam!
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: