SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/02/2018, 01:19 PM   #1
Loinal
Gangsta
 
Loinal's Avatar
 
Join Date: Feb 2016
Posts: 819
Reputation: 9
Default spam

PHP Code:
public OnPlayerUpdate(playerid)
{
    if(
GetPlayerWeapon(playerid) == 38)
    {
        if(
InDM[playerid] == false && DMType[playerid] != 3)
        {
            new 
string[280];
               foreach(new 
Player)
            {
                
format(stringsizeof(string), "* %s (ID: %d) has a minigun outside the minigun game!"GetName(playerid), playerid);
                  new 
irc[280];
                
format(ircsizeof(irc), "1,3* Anti-Cheat Alert: %s (ID: %d) has a minigun outside the minigun game"GetName(playerid), playerid);
                
IRC_Say(groupIDIRC_CHANNELirc);
                
IRC_Say(groupIDIRC_aCHANNELirc);
                if(
pData[i][Admin] >= 1)
                {
                    
SendClientMessage(iCOLOR_REDstring);
                }
            }
        }
    }
    return 
1;

i tried to add anti-cheat i have got too many spam when the player have minigun
__________________
Loinal is offline   Reply With Quote
Old 02/02/2018, 01:54 PM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,065
Reputation: 50
Default Re: spam

add timer.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 02/02/2018, 01:59 PM   #3
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 724
Reputation: 48
Default Re: spam

Quote:
Originally Posted by Mugalito View Post
add timer.
Omg? Are you post hunting or something? i only see you add bullshit everywhere.
Why the heck would he need a timer?

This isn't the first post where you are doing this.

ontopic:
I think the problem is with onplayerupdate, i have had that spamming too and couldnt fix it.
You can check at onplayerkeystatechange, so it detects if the player uses the weapon.
PHP Code:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(
newkeys KEY_FIRE)
    {
        if(
GetPlayerWeapon(playerid) == 38)
        {
            if(
InDM[playerid] == false && DMType[playerid] != 3)
            {
                new 
string[280];
                   foreach(new 
Player)
                {
                    
format(stringsizeof(string), "* %s (ID: %d) has a minigun outside the minigun game!"GetName(playerid), playerid);
                      new 
irc[280];
                    
format(ircsizeof(irc), "1,3* Anti-Cheat Alert: %s (ID: %d) has a minigun outside the minigun game"GetName(playerid), playerid);
                    
IRC_Say(groupIDIRC_CHANNELirc);
                    
IRC_Say(groupIDIRC_aCHANNELirc);
                    if(
pData[i][Admin] >= 1)
                    {
                        
SendClientMessage(iCOLOR_REDstring);
                    }
                }
            }
        }
    }
    return 
1;

jasperschellekens is offline   Reply With Quote
Old 02/02/2018, 02:20 PM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,065
Reputation: 50
Default Re: spam

Quote:
Originally Posted by jasperschellekens View Post
Omg? Are you post hunting or something? i only see you add bullshit everywhere.
Why the heck would he need a timer?

This isn't the first post where you are doing this.
it's a f7712ng OnPlayerUpdate callback, what should u do?
I'm scripting with Pawn from 2010 and I made a lot of codes, I cant even count and I know what the hell I'm talking.
Why none of my scripts have a bug or errors/warnings? cuz I know a sh1p(t)
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 02/02/2018, 02:48 PM   #5
Loinal
Gangsta
 
Loinal's Avatar
 
Join Date: Feb 2016
Posts: 819
Reputation: 9
Default Re: spam

Quote:
Originally Posted by Mugalito View Post
it's a f7712ng OnPlayerUpdate callback, what should u do?
I'm scripting with Pawn from 2010 and I made a lot of codes, I cant even count and I know what the hell I'm talking.
Why none of my scripts have a bug or errors/warnings? cuz I know a sh1p(t)
Quote:
Originally Posted by jasperschellekens View Post
Omg? Are you post hunting or something? i only see you add bullshit everywhere.
Why the heck would he need a timer?

This isn't the first post where you are doing this.

ontopic:
I think the problem is with onplayerupdate, i have had that spamming too and couldnt fix it.
You can check at onplayerkeystatechange, so it detects if the player uses the weapon.
PHP Code:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(
newkeys KEY_FIRE)
    {
        if(
GetPlayerWeapon(playerid) == 38)
        {
            if(
InDM[playerid] == false && DMType[playerid] != 3)
            {
                new 
string[280];
                   foreach(new 
Player)
                {
                    
format(stringsizeof(string), "* %s (ID: %d) has a minigun outside the minigun game!"GetName(playerid), playerid);
                      new 
irc[280];
                    
format(ircsizeof(irc), "1,3* Anti-Cheat Alert: %s (ID: %d) has a minigun outside the minigun game"GetName(playerid), playerid);
                    
IRC_Say(groupIDIRC_CHANNELirc);
                    
IRC_Say(groupIDIRC_aCHANNELirc);
                    if(
pData[i][Admin] >= 1)
                    {
                        
SendClientMessage(iCOLOR_REDstring);
                    }
                }
            }
        }
    }
    return 
1;

thanks for you both, i have fixed it
__________________
Loinal is offline   Reply With Quote
Old 02/02/2018, 03:25 PM   #6
edyun
Big Clucker
 
edyun's Avatar
 
Join Date: Sep 2014
Posts: 144
Reputation: 8
Default Re: spam

Quote:
Originally Posted by Mugalito View Post
it's a f7712ng OnPlayerUpdate callback, what should u do?
I'm scripting with Pawn from 2010 and I made a lot of codes, I cant even count and I know what the hell I'm talking.
Why none of my scripts have a bug or errors/warnings? cuz I know a sh1p(t)
You can be scripting from 10 years, I don't give a shit, this is a section where you need to explain, if you don't like it leave the hell out of here, we don't need dumbasses like you, you are probably one of the worst samp scripters ever, not cuz you don't have experience, cuz you don't have any common sense.
__________________
edyun is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spam CurlyPwn Scripting Help 6 22/05/2013 09:42 PM
Help me with Spam. Configuration Scripting Help 3 03/04/2013 12:00 PM
Bug Of SPAM VIPAwesome Scripting Help 4 05/03/2012 02:25 PM
[FilterScript] Spam Prevention System (Anti Spam) Luka P. Filterscripts 9 14/09/2011 12:56 PM
1 more help :P (sorry if this is spam) Cenation Help Archive 2 09/05/2011 06:20 AM


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.