Pleese look !
#1

i need help this spams the chat!

PHP код:
public ScheduledRespawn(){
                    new 
bool:unwanted[CAR_AMOUNT];
                    for(new 
i=0i<MAX_PLAYERSi++)
                    {
                    
SendClientMessage(i,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
                    for(new 
player=0player<MAX_PLAYERSplayer++)
                    {
                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                    }
                    for(new 
car 1car <= 400car++)
                    {
                    if(!
unwanted[car]) SetVehicleToRespawn(car);
                    }
                    }
                    } 
PHP код:
"• Toate masinile au fost respawnate ! • 
This is the problem
Reply
#2

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
                    {
                    SendClientMessage(i,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
OBVIOUSLY, it's because you have it INSIDE the loop, therefore it will right the message in the chat x amount of times (x being MAX_PLAYERS).

Place it outside the loop.
Reply
#3

Quote:
Originally Posted by Kindred
Посмотреть сообщение
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
                    {
                    SendClientMessage(i,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
OBVIOUSLY, it's because you have it INSIDE the loop, therefore it will right the message in the chat x amount of times (x being MAX_PLAYERS).

Place it outside the loop.
This will send message to every player once ONLY.

On Topic: show us where you call ScheduledRespawn(). With some timer or?
To find where are you using it press CTRL+F
Reply
#4

PHP код:
public SyncTime()
                    {
                    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++)
                    {
                    
SendClientMessageiYELLOW"• In 20 secunde toate masinile se vor respawna ! •");
                    
SetTimer("ScheduledRespawn",20000,false);
                    }
                    }
                    } 
Reply
#5

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
                    {
                    SendClientMessage( i, YELLOW, "• In 20 secunde toate masinile se vor respawna ! •");
                    SetTimer("ScheduledRespawn",20000,false);
                    }
(Taken from last post.)

change to
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    SendClientMessage( i, YELLOW, "• In 20 secunde toate masinile se vor respawna ! •");
}
SetTimer("ScheduledRespawn",20000,false);
Reply
#6

Quote:
Originally Posted by Akcent_Voltaj
Посмотреть сообщение
i need help this spams the chat!

PHP код:
public ScheduledRespawn(){
                    new 
bool:unwanted[CAR_AMOUNT];
                    for(new 
i=0i<MAX_PLAYERSi++)
                    {
                    
SendClientMessage(i,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
                    for(new 
player=0player<MAX_PLAYERSplayer++)
                    {
                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                    }
                    for(new 
car 1car <= 400car++)
                    {
                    if(!
unwanted[car]) SetVehicleToRespawn(car);
                    }
                    }
                    } 
PHP код:
"• Toate masinile au fost respawnate ! • 
This is the problem
This Spams!
Reply
#7

Why is there nested loop? This:

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    SendClientMessage(i,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
    for(new player=0; player<MAX_PLAYERS; player++)
    {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
    }
Reply
#8

Quote:
Originally Posted by Akcent_Voltaj
Посмотреть сообщение
This Spams!
Why don't you read my post?
Reply
#9

fixed. i made an onplayerregister mail

Type in your mail but i want to make it so it has to have "@" ...cause i typed dd and worked thats not good i want to type full adress or with .com.. .ca..

PHP код:
if(dialogid == 53)
                    {
                    if(
response)
                    {
                    
ShowPlayerDialog(playerid,53,DIALOG_STYLE_INPUT,"Scrieti Adresa Ta Yahoo!"," ","Ok","");
                    return 
0;
                    }
                    
RegistrationStep[playerid] = 0;
                    
TutTime[playerid] = 1;
                    
OnPlayerUpdateEx(playerid);
                    } 
Reply
#10

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
                    {
                    SendClientMessage( i, YELLOW, "• In 20 secunde toate masinile se vor respawna ! •");
                    SetTimer("ScheduledRespawn",20000,false);
                    }
(Taken from last post.)

change to
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    SendClientMessage( i, YELLOW, "• In 20 secunde toate masinile se vor respawna ! •");
}
SetTimer("ScheduledRespawn",20000,false);
this stills spams..... please help i thought i fixed it but no..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)