SA-MP Forums Archive
Spam help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spam help! (/showthread.php?tid=395457)



Spam help! - Akcent_Voltaj - 26.11.2012

it spams the chat..

PHP код:
        {
                    new 
string[64];
                    new 
tmphour;
                    new 
tmpminute;
                    new 
tmpsecond;
                    
gettime(tmphourtmpminutetmpsecond);
                    if ((
tmphour ghour) || (tmphour == && ghour == 23))
                    {
                    
format(stringsizeof(string), "Este ora Fix Ceasul acuma este: %d:00 Succes incontinuare!",tmphour);
                    
BroadCast(COLOR_WHITE,string);
                    
ghour tmphour;
                    
PayDay();
                    if (
realtime)
                    {
                    
SetWorldTime(tmphour);
                    }
                    for(new 
i=0i<MAX_PLAYERSi++)
                    {
                        
SendClientMessageiCOLOR_YELLOW"• In 20 secunde toate masinile se vor respawna ! •"); // this spams chat!!
                    
}
                    
SetTimer("ScheduledRespawn",20000,false);
                    }
                    } 
PHP код:
public ScheduledRespawn(playerid)
                    {
                    new 
bool:unwanted[CAR_AMOUNT];
                    for(new 
0MAX_PLAYERSi++)
                    {
                    for(new 
player=0player<MAX_PLAYERSplayer++)
                    {
                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                    }
                    for(new 
car 1car <= 359car++)
                    {
                        if(!
unwanted[car]) SetVehicleToRespawn(car);
                    }
                    
SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
                    }
                    } 



Re: Spam help! - Akcent_Voltaj - 26.11.2012

please help..


Re: Spam help! - teomakedonija - 26.11.2012

PHP код:
public ScheduledRespawn(playerid
                    { 
                    new 
bool:unwanted[CAR_AMOUNT]; 
                    for(new 
0MAX_PLAYERSi++) 
                    { 
                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } 
                    } 
                    for(new 
car 1car <= 359car++) 
                    { 
                        if(!
unwanted[car]) SetVehicleToRespawn(car); 
                    } 
                    
SendClientMessage(i,COLOR_YELLOW,"Toate masinile au fost respawnate !"); 
                    } 
                    } 



Re: Spam help! - Akcent_Voltaj - 30.11.2012

no work..can anyone else help +REP! Toate masinile au fost respawnate spams..


Re: Spam help! - [D]ry[D]esert - 30.11.2012

You have to check if player is connected or it will send you message as your MAX_PLAYERS Define ..
"But how ?":
try this:
pawn Код:
{
                    new string[64];
                    new tmphour;
                    new tmpminute;
                    new tmpsecond;
                    gettime(tmphour, tmpminute, tmpsecond);
                    if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
                    {
                    format(string, sizeof(string), "Este ora Fix Ceasul acuma este: %d:00 Succes incontinuare!",tmphour);
                    BroadCast(COLOR_WHITE,string);
                    ghour = tmphour;
                    PayDay();
                    if (realtime)
                    {
                    SetWorldTime(tmphour);
                    }
                    for(new i=0; i<MAX_PLAYERS; i++)
                    {
                        if(!IsPlayerConnected(i)) return 0; // add this one. so if player isnt connected it wont send him message.
                        SendClientMessage( i, COLOR_YELLOW, "• In 20 secunde toate masinile se vor respawna ! •"); // this spams chat!!
                    }
                    SetTimer("ScheduledRespawn",20000,false);
                    }
                    }



Re: Spam help! - Hugoca - 30.11.2012

Try to use
pawn Код:
SendClientMessageToAll(COLOR_YELLOW, "• In 20 secunde toate masinile se vor respawna ! •"); // this spams chat!!