Jump to content
  • 0

pomoc Jednoduchý AntiSpam


Tedy

Dotaz

6 odpovědí na tuto otázku

Recommended Posts

  • 0

Tady :)

new spam[MAX_PLAYERS]; //K Newum

forward Anti_spam(playerid); //K Forwardum
 
public OnPlayerText(playerid, text[])
{
    if(spam[playerid] == 1)
    {
    SendClientMessage(playerid,cervena,"[Anti-Spam] Jen jedna správa za 5 sekund.");
    return 0;
    }
    else
    {
    spam[playerid] = 1;
    SetTimerEx("Anti_spam",5000,0,"i",playerid);
    }
    return 1;
}

public Anti_spam(playerid)
{
    spam[playerid] = 0;
    return 1;
}

Je to dělané podle návodu :) Čas si nastav sám v Timeru :)

Link to comment
Share on other sites

  • 0

 

Errory -

 

C:\Users\Pc\Desktop\AntiSpam.pwn(1) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Pc\Desktop\AntiSpam.pwn(1) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Pc\Desktop\AntiSpam.pwn(5) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Users\Pc\Desktop\AntiSpam.pwn(9) : error 017: undefined symbol "SendClientMessage"
C:\Users\Pc\Desktop\AntiSpam.pwn(15) : error 017: undefined symbol "SetTimerEx"
Link to comment
Share on other sites

  • 0

jednoduché a krátke:

 

 

public OnPlayerText(playerid, text[])
{
 
if(gettime()-GetPVarInt(playerid,"AntiSpam") < 3)
{
SendClientMessage(playerid, -1, "Nespamuj. Jedna správa raz za 3 sekundy.");
return false;
} else {
SetPVarInt(playerid,"AntiSpam",gettime());
}
 
return false;
}
Link to comment
Share on other sites

  • 0

Děkuji,ale hází to zase errory :

 

C:\Users\Pc\Desktop\AntiSpam.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Users\Pc\Desktop\AntiSpam.pwn(4) : error 017: undefined symbol "gettime"
C:\Users\Pc\Desktop\AntiSpam.pwn(6) : error 017: undefined symbol "SendClientMessage"
C:\Users\Pc\Desktop\AntiSpam.pwn(9) : error 017: undefined symbol "SetPVarInt"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...