run command from gamemode in filterscript
#1

Happy new Year everyone!

Best wishes to all.

I've got a question; is there a way to run a command from a gamemode in a filterscript?
For example when a player uses /hello (from the filterscript) it will run also /commands (described in the gamemode).
Reply
#2

You mean when he types /hello it shows him the Commands?
Well if that ok

Quote:

if (strcmp("/hello", cmdtext, true, 10) == 0)
{
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_BLUE, "------- Server Commands ------");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF}");
SendClientMessage(playerid, COLOR_BLUE, "[INFO]{00FFFF} ");

return 1;



}

Just paste this under OnPlayerCommandText
Reply
#3

Just load the filterscript?
Reply
#4

Ty for the answers, but it's not where I'm looking for.

For example when I create a filterscript for driving lessons, I would like to run the command /getlic which is described in the gamemode. So I do not have to import the whole saving system in my filterscript to set Playerinfo[playerid][pDriverlic] = 1.

Is that possible?
Reply
#5

Does anyone know how to do this?
Reply
#6

https://sampwiki.blast.hk/wiki/CallRemoteFunction

In the first parameter use: cmd_getlic
In the second parameter use: "is"
In the last one (arguments) use the playerid and the params you want for that command.
Reply
#7

Ty for the answer. Should I do:

CallRemoteFunction("cmd_getlic", "is", playerid");

Will this automatically call the command /getlic listed in the gamemode from the filterscript?
Reply
#8

Yes, it calls a public function in any script you use.
pawn Код:
CallRemoteFunction("cmd_getlic", "is", playerid, "");
Reply
#9

Just return 0 at your filterscript. The server will think, that the command does not exist and proceeds to other scripts including your game mode.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)