SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 31/05/2017, 11:44 PM   #1
Loinal
Gangsta
 
Loinal's Avatar
 
Join Date: Feb 2016
Posts: 817
Reputation: 9
Default Spamming

PHP Code:
//OnGameModeInIT
SetTimer("SaveAllPlayerData",180000,1);

forward SaveAllPlayerData();
public 
SaveAllPlayerData()
{
    for (new 
0MAX_PLAYERSi++)
    {
        if( 
IsPlayerConnected) )
        {
            new 
query[600];
            
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `IP` = '%e', `Admin` = %d, `Tokens` = %d, `Kills` = %d,`Deaths` = %d, `Score` = %d, `Money` = %d, `Hours` = %d,\
            `Minutes` = %d, `RaceWon` = %d WHERE `ID` = %d"
,
            
IP[i], pData[i][Admin], pData[i][Tokens], pData[i][Kills],pData[i][Deaths], GetPlayerScore(i),\
            
pData[i][Money], pData[i][pHours], pData[i][pMinutes],pData[i][RaceWon], pData[i][ID]);            
            
mysql_tquery(mysqlquery);
        }
        new 
str[128];
        
SendClientMessageToAll(0x009D00DB,"* Admin spork007 has saved your stats");
        
format(strsizeof(str),"* Admin spork007 has saved all online players stats");
        
IRC_GroupSay(groupIDIRC_CHANNELstr);
    }
    return 
1;

That spam the irc and the game
__________________
Loinal is offline   Reply With Quote
Old 31/05/2017, 11:47 PM   #2
ShihabSoft
Banned
 
Join Date: Jun 2016
Posts: 156
Reputation: 8
Default Re: Spamming

Ah isn't that obvious mate?

Just paste the message sending code outside the loop.

PHP Code:

//After the FOR loop.
    
        
new str[128]; 
        
SendClientMessageToAll(0x009D00DB,"* Admin spork007 has saved your stats"); 
        
format(strsizeof(str),"* Admin spork007 has saved all online players stats"); 
        
IRC_GroupSay(groupIDIRC_CHANNELstr); 
ShihabSoft is offline   Reply With Quote
Old 31/05/2017, 11:48 PM   #3
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 697
Reputation: 146
Default Re: Spamming

If both the SendClientMessageToAll and the IRC_GroupSay are inside the loop, the only logically outcome is for these functions to repeat themselves the amount of times the loop loops, right?
__________________
Scripting Help in a nutshell

Quote:
Originally Posted by Thanks View Post
So.. hey everyone im trying to searching at ****** how to make leaderboard with Textdraws so i find many but Not in my brain...
Toroi 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
CMD:bk spamming. fonia5 Scripting Help 4 17/02/2015 06:44 AM
Spamming thefatshizms Scripting Help 3 28/06/2013 06:07 AM
spamming pelani Scripting Help 2 12/02/2013 08:43 AM
It Keep Spamming Windrush Scripting Help 8 19/12/2012 11:16 AM
Problem with Spamming tomnidi Help Archive 9 05/03/2009 01:58 PM


All times are GMT. The time now is 08:52 PM.


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