15.06.2011, 11:54
To disable a certain class:
In the main gamemode file (PPC_Trucking.pwn) you'll find the function
public OnPlayerRequestSpawn(playerid)
This function executes code when you choose to spawn as a member of a specific class.
You'll find this code in there:
You can change it to this:
This will prevent anyone to choose the courier-class as it has been disabled by the "return 0;".
This blocks the function to spawn the player as the chosen class.
Also the player will be informed that this class has been disabled.
You can use the same setup to disable any other class.
In the main gamemode file (PPC_Trucking.pwn) you'll find the function
public OnPlayerRequestSpawn(playerid)
This function executes code when you choose to spawn as a member of a specific class.
You'll find this code in there:
Code:
case ClassCourier: { Index = random(sizeof(ASpawnLocationsCourier)); x = ASpawnLocationsCourier[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsCourier[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsCourier[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsCourier[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Courier class", Name); }
Code:
case ClassCourier: { Index = random(sizeof(ASpawnLocationsCourier)); x = ASpawnLocationsCourier[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsCourier[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsCourier[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsCourier[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation // format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Courier class", Name); // Let the player know he cannot choose courier class as the admin disabled this class GameTextForPlayer(playerid, "Courier-class has been disabled by the server-admin", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Courier-class has been disabled by the server-admin"); return 0; // Don't allow the player to spawn as courier player }
This blocks the function to spawn the player as the chosen class.
Also the player will be informed that this class has been disabled.
You can use the same setup to disable any other class.