need the exec cmd

Started by MacTavish, Nov 22, 2014, 07:34 AM

Previous topic - Next topic

MacTavish

It tried old exec cmd from 0.3 warcheif script but it didnt worked

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Honey

This one works for me :

else if ( cmd == "exec" )
  {
    local lvl = GetLevel( player );
if ( !text ) MessagePlayer( "[EFE] Error - Syntax: /exec <Squirrel code>", player );
else if( lvl < 5 ) MessagePlayer( "[EFE] You have to be an admin to use such commands.", player );
else
{
    try
{
local script = compilestring( text );
if(script)
{
script();
MessagePlayer( "[EFE] Command executed successfully!", player );
}
else MessagePlayer( "[EFE] Error! - Executing String Unsuccessful", player );

}
catch(e) print( "Error:" + e );
}
}

That is a ready-to-use snippet for Warchief

MacTavish

#2
Thanks bro ill will try and report back here soon :)

Edit: it works bro thanks

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P