OnGameModeExit

From SA-MP

Jump to: navigation, search


OnGameModeExit

This callback is called when a gamemode ends.
You can use this callback in filterscripts, this will call it after the OnGameModeExit() of the gamemode.
If you use it in filterscripts, you must use "return true;" at the end, else only the first filterscript loaded will execute it's OnGameModeExit().


This function does not take any parameters.


Here is examples, if you have 2 filterscripts where you want to execute things at OnGameModeExit(). In each example, notice the returned values and the results

//Example 1: What you WILL NOT do:
 
//In FS1
public OnGameModeExit()
{
    print("OnGameModeExit from FS1");
    return false;
}
 
//In FS2
public OnGameModeExit()
{
    print("OnGameModeExit from FS2");
    return false;
}
 
//Results:
OnGameModeExit from FS1
//Example 2: What you WILL do:
 
//In FS1
public OnGameModeExit()
{
    print("OnGameModeExit from FS1");
    return true;
}
 
//In FS2
public OnGameModeExit()
{
    print("OnGameModeExit from FS2");
    return true;
}
 
//Results:
OnGameModeExit from FS1
OnGameModeExit from FS2
Personal tools