SendClientMessage Bug
#1

Hello Help Me

I Have A Little Buggy With SendClientMessage

Pic-


Quote:

else if (dialogid == D_RADIO_PINPUT1 && response)
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid))
{
PlayAudioStreamForPlayer(i,inputtext);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
}

}

Reply
#2

What is the bug?
Reply
#3

so many SendClientMessage i got .. look at the pic
Reply
#4

else if (dialogid == D_RADIO_PINPUT1 && response)
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
{
PlayAudioStreamForPlayer(i,inputtext);
}

}
Reply
#5

pawn Код:
else if (dialogid == D_RADIO_PINPUT1 && response)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
 if(IsPlayerAdmin(playerid))
{
PlayAudioStreamForPlayer(i,inputtext);
break;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
break;
}
}
}
Always use break; if you want the loop to end, else it will just go on and go on untill ut reaches his target, this way the loop will end when it finds someting.

Im sorry if the code looks messy, i typed it from my mobile which doesnt works pretty well sometimes.
Im very sure this code will work though.
If it doesnt, then ill help you later when i get on my computer.
Reply
#6

Код:
else if (dialogid == D_RADIO_PINPUT1 && response)
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
PlayAudioStreamForPlayer(i,inputtext);
}
else
{
SendClientMessage(i,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
}

}
Try it.
Reply
#7

Код:
else if (dialogid == D_RADIO_PINPUT1 && response)
{
if (!IsPlayerAdmin (playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerAdmin (i)) PlayAudioStreamForPlayer(i,inputtext);
}
}
Or edit

Код:
if (IsPlayerAdmin (i)) PlayAudioStreamForPlayer(i,inputtext);
else SendClientMessage(i,COLOR_YELLOW,"ERROR:{FF 00EA}You {A90202}NOT A {3FCD02}STAFF!");
I'm pretty sure you want the first, the function is available only for admins? Use the first. If you really want the second, why who is not admin should see this message?
Reply
#8

He just should tell us what the code should do :/
Reply
#9

tnx a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)