mercredi 2 septembre 2015

OnPlayerText

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 Code:

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 Code:

stock GetAdminLevel(playerid
{
return 
PlayerInfo[playerid][pAdmin];


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


Aucun commentaire:

Enregistrer un commentaire