undefined
#1

why is str undefined ?

Код:
	if(pInfo[playerid][Admin] < 1)
	{
		if(text[0] == '@')
		{
          new str[128];
		  format(str, sizeof(str), "{F781F3}(ADMIN CHAT) %s(%d): %s", PlayerName[playerid],playerid, str);
		  SendMessageToAdmins(str);
		}
		else if(pInfo[playerid][Admin] == 0)
		{
		   SendClientMessageToAll(-1, str);
		}
	}
    return 0;
}
PHP код:
SendClientMessageToAll(-1str); 
Reply
#2

PHP код:
if(pInfo[playerid][Admin] < 1)
    {
new 
str[128];
        if(
text[0] == '@')
        {
          
          
format(strsizeof(str), "{F781F3}(ADMIN CHAT) %s(%d): %s"PlayerName[playerid],playeridstr);
          
SendMessageToAdmins(str);
        }
        else if(
pInfo[playerid][Admin] == 0)
        {
           
SendClientMessageToAll(-1str);
        }
    }
    return 
0;

This will fix the error, but you are doing it wrong. It won't work good try it for yourself.
Reply
#3

yes it did remove the include but the code doesn't seem really much different from what i've searched on how to make teamchats(admin chat in my side),

it just shows on global chat @ text
Reply
#4

bump
Reply
#5

24 hour bumps only, and ensure you aren't running other FS that control the chat, or that you're returning the right returns on callbacks you use.
Reply
#6

You format the string only inside the if.

You need to format the string in the else {} as well, otherwise str will be empty at that point.
Reply
#7

PHP код:
    if(text[0] == '@' && pInfo[playerid][Admin] > 0)
    {
        new 
str[128];
        
format(strsizeof(str), "{F781F3}(ADMIN CHAT) %s(%d): %s"PlayerName[playerid],playeridstr);
        
SendMessageToAdmins(str);
        return 
0;
    }
    
SendPlayerMessageToAll(playerid,text);
    return 
0;

Try this, I think this might be something you are trying to script.
Reply
#8

Quote:
Originally Posted by NaS
Посмотреть сообщение
You format the string only inside the if.

You need to format the string in the else {} as well, otherwise str will be empty at that point.
^^^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)