10.10.2015, 18:08
PHP код:
#include <sscanf2>
CMD:changemission(playerid, params[])
{
if(IsPlayerAdmin(playerid)
{
new mission[50], cmd[50]; //strings
if(sscanf(params, "s", mission)) return SendClientMessage(playerid, -1, "USAGE: /changemission (mission)"); //if playerid doesnt type in mission name playerid will get error message
format(cmd, sizeof(cmd), "changemode %s", mission); //formatting the string to be used in SendRconCommand
SendRconCommand(cmd); //calling the command and changing the gamemode
}
return 1;
}
sscanf2 (needed to use code): https://sampforum.blast.hk/showthread.php?tid=570927
SendRconCommand: https://sampwiki.blast.hk/wiki/SendRconCommand