Author Topic: what is the error ?  (Read 1501 times)

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
what is the error ?
« on: September 05, 2012, 02: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 .
« Last Edit: September 05, 2012, 04:52:35 pm by mido_pop »



Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: what is the error ?
« Reply #1 on: September 05, 2012, 10: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;
}
« Last Edit: September 05, 2012, 10:19:36 pm by Vortrex »

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: what is the error ?
« Reply #2 on: September 05, 2012, 11:06:37 pm »
Man When i Type /unload <script> server close why ?  :'(



Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: what is the error ?
« Reply #3 on: September 06, 2012, 02:42:26 am »
Did you unload the script that has the "/unload" command in it?

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: what is the error ?
« Reply #4 on: September 07, 2012, 07:28:20 pm »
LOL no .
« Last Edit: January 23, 2013, 06:17:11 pm by mido_pop »



 

© Liberty Unleashed Team.