Loop problem: sending message -
None1337 - 16.12.2017
Hello guys, I have a war system on my server, and sometimes in my global timer (1sec) SendClientMessage is sending twice in a loop.
Here you have a screnshot:
https://i.imgur.com/sEMrdvT.png
All code:
https://pastebin.com/7Ai4zQMQ
If someone can help me, please!
Re: Loop problem: sending message -
Bolex_ - 16.12.2017
The message/s should be outside loop.
Re: Loop problem: sending message -
None1337 - 16.12.2017
Quote:
Originally Posted by Bolex_
The message/s should be outside loop.
|
There are a loot of messages, how should I do that?
Re: Loop problem: sending message -
RogueDrifter - 16.12.2017
Quote:
Originally Posted by None1337
There are a loot of messages, how should I do that?
|
Drag them outside the loop and use SendClientMessageForAll if you're sending it to all players?
say for an ex if it was like
PHP код:
for( new...)
{
//code
SendClientMessage(...
}
//drag that send client message outside so it'd be
for(new..
{
//code
}
SendClientMessage(..
Re: Loop problem: sending message -
None1337 - 16.12.2017
Quote:
Originally Posted by RogueDrifter
Drag them outside the loop and use SendClientMessageForAll if you're sending it to all players?
say for an ex if it was like
PHP код:
for( new...)
{
//code
SendClientMessage(...
}
//drag that send client message outside so it'd be
for(new..
{
//code
}
SendClientMessage(..
|
I only send the message to the two mafia groups.
In this way, I should define, aprox. I think 5-6 new strings.
Is not there another way?
Re: Loop problem: sending message -
RogueDrifter - 16.12.2017
Quote:
Originally Posted by None1337
I only send the message to the two mafia groups.
In this way, I should define, aprox. I think 5-6 new strings.
Is not there another way?
|
Then make the loop check for those mafias like if(PlayerInfo[playerid][pMafia]) SendClientMessage(playerid,-1,string); and i have no idea what you mean by define approx 5-6 new strings?
Re: Loop problem: sending message -
None1337 - 16.12.2017
I have already my function SendFamilyMessage(groupid, color, string[]);
Re: Loop problem: sending message -
Sew_Sumi - 16.12.2017
Copy paste will only get you so far, and you should not need to create 5-6 strings for something such as this.
If this is a timer, this is seriously overloaded. You don't need strings to be 256 chars long. You also don't need to have as many strings, as long a string, or as many variables through all of that.