05.12.2009, 21:55 
	
	
	pawn Код:
new
FALSE = 0;
pawn Код:
#if !defined SendRconCommandEx
#define SendRconCommandEx(%0,%1) \
do \
{ \
new \
string[64]; \
if(strlen(%0) > 0) \
{ \
format(string, sizeof(string), %0, %1); \
SendRconCommand(string); \
} \
} \
while(FALSE)
#endif
pawn Код:
#if !defined CallRemoteFunctionEx
#define CallRemoteFunctionEx(%0,%1,%2,%3,%4) \
do \
{ \
new \
string[64]; \
format(string, sizeof(string), %3, %4); \
CallRemoteFunction(%0, %1, %2, string); \
} \
while(FALSE)
#endif
pawn Код:
stock SetServerName(name[])
{
SendRconCommandEx("hostname %s", name);
printf("Setting server name to: \"%s\"", name);
return true;
}
pawn Код:
// example:
SetServerName("SA-MP v0.3a server");
pawn Код:
stock SetServerGamemode(gamemode[])
{
SendRconCommandEx("gamemodetext %s", gamemode);
printf("Setting server gamemode name to: \"%s\"", gamemode);
return true;
}
pawn Код:
// example:
SetServerGamemode("San Andreas Role-Play");
pawn Код:
stock SetServerMap(map[])
{
SendRconCommandEx("mapname %s", map);
printf("Setting server map name to: \"%s\"", map);
return true;
}
pawn Код:
// example:
SetServerMap("Liberty City");
pawn Код:
stock ForcePlayerCommand(playerid, command[])
{
if(IsPlayerConnected(playerid))
{
new
playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
CallRemoteFunctionEx("OnPlayerCommandText", "is", playerid, "/%s", command);
printf("Forcing player command: Player: \"%s (%i)\", Command: \"/%s\"", playername, playerid, command);
}
else printf("ERROR: That player is not connected to the server!");
return true;
}
pawn Код:
// example:
ForcePlayerCommand(playerid, "/ooc Hello!");


