OnPlayerText
#1

Ok, i made this for admin chat in other gamemode it was working, now its simple showing "@hi" or "@@hi" instead of admin - mod chat
heres code

PHP код:
if (text[0] == '@')
    {
        if (
text[1] == '@')
        {
            if (
GetAdminLevel(playerid) >= LEVEL_MOD || IsPlayerAdmin(playerid))
            {
                new 
name[MAX_PLAYER_NAME];
                new 
tmpstr[125];
                
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
                
format(tmpstr,sizeof(tmpstr),"%s: %s",name,text[2]);
                
SendMessageToMods(tmpstr);
                return 
0;
            }
        
        }
        else if (
GetAdminLevel(playerid) >= LEVEL_ADMIN || IsPlayerAdmin(playerid))
        {
            new 
name[MAX_PLAYER_NAME];
            new 
tmpstr[125];
            
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
            
format(tmpstr,sizeof(tmpstr),"%s: %s",name,text[1]);
            
SendMessageToAdmins(tmpstr);
            return 
0;        
        }
        return 
0;
    
    } 
Also i logging in rcon, setting my admin level to 3 but nothing, heres my getadminlevel stock

PHP код:
stock GetAdminLevel(playerid
{
return 
PlayerInfo[playerid][pAdmin];

In commands it working, but i dk why it doesn't work here :S
Reply
#2

Okey nevermind, found smth was returning 1 above lolololol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)