Jump to content

About MTA server commands


SkatCh

Recommended Posts

Posted

hi guys please can any one help me i create a script to prevent players in my server from using server command , like start , restart , refresh , etc ... but me too i can't use them : (i'm staff ) .

i will explane my script it's server side scripte i create table with all MTA server commands eg :

Command = { 
['delaccount']      = true;  
} -- etc .... 
  
-- then i create this function : 
addEventHandler ( 'onPlayerCommand',getRootElement ( ), 
    function ( cmd ) 
        if Command [ cmd ] then 
            cancelEvent (   ); 
            kickPlayer ( source, "Command Not Allowed" ); 
        end; 
    end 
); 

so my question how can i make admin will be able to use those commands i tried many exports function : like isPlayerInTeams , isPlayerStaff but i think there is something wrong , thx fro help .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

how because i edit ACLgroups , i delete Admin , moderator , etc .. and i changed them with Head Staff > trial Staff .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

Commands = { 
'start', 
'stop', 
'refresh', 
'banPlayer', 
'delaccount' 
} 
  
addEventHandler ( 'onPlayerCommand',getRootElement ( ), 
function ( nCommand ) 
    for _, Max in ipairs ( Commands ) do 
     if Commands [ nCommand ] and  ( hasObjectPermissionTo ( source, "function.setServerPassword", false ) ) then 
      kickPlayer ( source, "Command Not Allowed" ); 
    end 
  end 
end 
) 

use /debugscript 3 for erros ..

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
Commands = { 
'start', 
'stop', 
'refresh', 
'banPlayer', 
'delaccount' 
} 
  
addEventHandler ( 'onPlayerCommand',getRootElement ( ), 
function ( nCommand ) 
    for _, Max in ipairs ( Commands ) do 
     if Commands [ nCommand ] and  ( hasObjectPermissionTo ( source, "function.setServerPassword", false ) ) then 
      kickPlayer ( source, "Command Not Allowed" ); 
    end 
  end 
end 
) 

use /debugscript 3 for erros ..

The loop in this wouldn't work.

Try using this:

local commands = { 
    ['start'] = true, 
    ['stop'] = true, 
    ['refresh'] = true, 
    ['banPlayer'] = true,    
    ['delaccount'] = true 
} 
  
  
addEventHandler ( "onPlayerCommand", root, function ( cmd ) 
    if ( commands [ cmd:lower() ] ) then  
        cancelEvent ( ) 
        outputChatBox ( "This command isn't allowed in the server.", source, 255, 0, 0 ) 
    end  
end ) 

Posted

WTF topic can be locked some stupid answers .my script is working fine just i'm asking how to make admin able to use those command without being kicked .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted
WTF topic can be locked some stupid answers .my script is working fine just i'm asking how to make admin able to use those command without being kicked .

stupid answers ? your the one how blowed the acl groups ! and they will not be abel to use these commands , if they are not admin

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...