14.05.2013, 16:08
I am making a new gamemode, and i've tried something like this:
On the top of the gamemode:
So the gamemode will be cleaner and everything, and now I made an enum called PlayerInfo.
When i'm trying to add a stock in the include MainStocks.inc for example:
It gives me an error that PlayerInfo isn't definded.
On the top of the gamemode:
pawn Код:
#include "Server\Publics\OnVehicleSpawn.inc" // When vehicles spawn
#include "Server\Publics\OnVehicleDeath.inc" // When vehicles explodes
#include "Server\Publics\OnPlayerStateChange.inc" // When player changes his state, Ex. From FOOT to DRIVER
#include "Server\Publics\OnPlayerSpawn.inc" // When player spawns
#include "Server\Publics\OnPlayerRequestSpawn.inc" // When player is pressing the spawn button
#include "Server\Publics\OnPlayerEnterRaceCheckpoint.inc" // When player enters a race checkpoint
#include "Server\Publics\OnPlayerLeaveRaceCheckpoint.inc" // When player leaves a race checkpoint
#include "Server\Publics\OnPlayerEnterCheckpoint.inc" // When player enters a normal checkpoint
#include "Server\Publics\OnPlayerLeaveCheckpoint.inc" // When player leaves a normal checkpoint
#include "Server\Publics\OnPlayerExitVehicle.inc" // When player presses ENTER to exit a vehicle
#include "Server\Publics\OnPlayerEnterVehicle.inc" // When player presses ENTER to enter a vehicle
#include "Server\Publics\OnPlayerDeath.inc" // When player dies
#include "Server\Publics\OnObjectMoved.inc" // When object is being moved
#include "Server\Publics\OnPlayerUpdate.inc" // When player info gets updated, called every 1 second. [I think so..:/]
#include "Server\Publics\OnPlayerStreamIn.inc" // When a player streams in for other player
#include "Server\Publics\OnPlayerStreamOut.inc" // When a player streams out for other player
#include "Server\Publics\OnVehicleStreamIn.inc" // When a vehicle steams in for a player
#include "Server\Publics\OnVehicleStreamOut.inc" // When a vehicle steams out for a player
#include "Server\Publics\OnPlayerKeyStateChange.inc" // When a player clicked something
#include "Server\Publics\OnGameModeInit.inc" // When a player clicked something
#include "Server\Publics\OnGameModeExit.inc" // When a player clicked something
#include "Server\Others\MainStocks.inc" // Server main stocks
#include "Server\Others\Defines.inc" // All kind of defines
#include "Server\Others\Enums.inc" // All kind of enums
pawn Код:
enum P_INFO
{
pDatabaseID,
pCash,
pSkin
}
new PlayerInfo[ MAX_PLAYERS ][ P_INFO ];
pawn Код:
stock ResetPlayerVariables(playerid)
{
PlayerInfo[ playerid ][ pCash ] = 0;
return 1;
}