Liberty Unleashed

Scripting => Script Help => Topic started by: Mido_Pop on September 05, 2012, 01:07:28 pm

Title: what is the error ?
Post by: Mido_Pop on September 05, 2012, 01:07:28 pm
function onPlayerCommand( id, cmd, text )
{
    if ( cmd == "unloadRace" )
    {
        UnloadScript( "Race" );
        Message( "Race Script unloaded!" );
    }
    return 1;
}

i need to make command unload any script .
Title: Re: what is the error ?
Post by: Vortrex on September 05, 2012, 09:17:05 pm
This should do the trick (although it's untested on my part). Remember, this command would now be "/unload" instead of "/unloadrace"

Code: [Select]
function onPlayerCommand( player, command, params )
{
if ( command == "unload" )
{
if( params )
{
if( UnloadScript( params ) )
{
Message( params   " script unloaded!" );
}
else
{
Message( params   " script could not be unloaded!" );
}
}
else
{
MessagePlayer( "Syntax: /unload <scriptname>", player );
}
}
return 1;
}
Title: Re: what is the error ?
Post by: Mido_Pop on September 05, 2012, 10:06:37 pm
Man When i Type /unload <script> server close why ?  :'(
Title: Re: what is the error ?
Post by: Vortrex on September 06, 2012, 01:42:26 am
Did you unload the script that has the "/unload" command in it?
Title: Re: what is the error ?
Post by: Mido_Pop on September 07, 2012, 06:28:20 pm
LOL no .