02.09.2014, 10:15
(
Последний раз редактировалось Mariawantstowatchtv; 13.09.2014 в 10:55.
)
Can anybody show me an example of how y_masters, can be used to share data between a filter script and a game mode?
[gamemode.pwn]
forward Something();
public Something(); { return 42; }
[filterscript.pwn -> functions.inc]
stock Something() { return CallRemoteFunction("Something", ""); }
[anticheat.pwn -> functions.inc]
stock Something() { return CallRemoteFunction("Something", ""); }
Yes, y_master will solve that problem, by using "SERVER" and "CLIENT" scripts.
|
Also, my current structure is this:
pawn Код:
|
Yes, y_master will solve that problem, by using "SERVER" and "CLIENT" scripts.
|
*fs_streamer.pwn
pawn Code:
#define YSI_IS_SERVER
#include <funcs_streamer>
*fs_users.pwn
pawn Code:
#define YSI_IS_SERVER
#include <funcs_users>
gamemode.pwn
pawn Code:
#define YSI_IS_CLIENT
#include <fs_streamer>
#include <fs_users>
main()
{
}
gamemode.pwn
pawn Code:
#define YSI_IS_CLIENT
#include <funcs_streamer>
#include <funcs_users>
main()
{
}
funcs_users.inc
This is using "MASTER" number 1.
pawn Code:
#define YSI_IS_CLIENT
#define MASTER 1
#include <YSI\y_master>
static stock
gsLoggedIn[MAX_PLAYERS];
foreign bool:IsLoggedIn(playerid);
global bool:IsLoggedIn(playerid)
{
return gsLoggedIn[playerid];
}
#define MASTER 2
#include <YSI\y_master>
foreign AddObject(model, Float:x, Float:y, Float:z);
global AddObject(model, Float:x, Float:y, Float:z)
{
new
objectid = /* something */;
return objectid;
}
main()
{
}
No, once "AddObject" has been declared, it knows which master to use forever. And the first version with multiple includes is better. You CAN do it all in one file, but that's not generally recommended.
|
gamemode.pwn
pawn Code:
#define YSI_IS_CLIENT
#include <fs_streamer>
#include <fs_users>
main()
{
}
#define MASTER 1
#include <YSI\y_master>
#define MASTER 6
#include <YSI\y_master>
#define MASTER 4
#include <YSI\y_master>
#include <YSI\y_master>// reset for commands ?