SA-MP Forums Archive
Filterscript dosn't work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Filterscript dosn't work? (/showthread.php?tid=131830)



Filterscript dosn't work? - Naxix - 05.03.2010

Hey, i was making a rcon admin script with strcmp (i'm gonna make it with both strcmp and dcmd)
and i just wanted to test a few commands, but when i load a gamemode like bare and i get in if i type like /acmds nothing happens
(it returns 0; if you aren't logged into rcon command, so it should say "SERVER: Unknown Server Command" but it dosen't)
and if i login with rcon same happens, nothing at all but i can type like "lol" so it's not lag as far as i know.
any1 know why this would happend?

-Naixix


Re: Filterscript dosn't work? - adsy - 05.03.2010

did you load the filterscripts?

Use loadfs then the script name in rcon

also return 0 at the end of onplayercommandtext in both scripts


Re: Filterscript dosn't work? - Naxix - 05.03.2010

Quote:
Originally Posted by adsy
did you load the filterscripts?

Use loadfs then the script name in rcon

also return 0 at the end of onplayercommandtext in both scripts
Umm.. I will try the loadfs.. But if i return 0 at OnplayerCommandText it will write "Server: Unknown Server Command" even if i use the commands?


Re: Filterscript dosn't work? - adsy - 05.03.2010

Quote:
Originally Posted by Naxix
Quote:
Originally Posted by adsy
did you load the filterscripts?

Use loadfs then the script name in rcon

also return 0 at the end of onplayercommandtext in both scripts
Umm.. I will try the loadfs.. But if i return 0 at OnplayerCommandText it will write "Server: Unknown Server Command" even if i use the commands?
i use return 0 at the end of each different onplayercommandtext but i use return 1 for each command within

example
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[48];
  new idx;
  cmd = strtok(cmdtext, idx);
  if(strcmp(cmd, "/normal", true) == 0) {
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  return 0;
}



Re: Filterscript dosn't work? - Naxix - 05.03.2010

Quote:
Originally Posted by adsy
Quote:
Originally Posted by Naxix
Quote:
Originally Posted by adsy
did you load the filterscripts?

Use loadfs then the script name in rcon

also return 0 at the end of onplayercommandtext in both scripts
Umm.. I will try the loadfs.. But if i return 0 at OnplayerCommandText it will write "Server: Unknown Server Command" even if i use the commands?
i use return 0 at the end of each different onplayercommandtext but i use return 1 for each command within

example
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[48];
  new idx;
  cmd = strtok(cmdtext, idx);
  if(strcmp(cmd, "/normal", true) == 0) {
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  return 0;
}
This is the last command in my FS:

Код:
 	if (strcmp("/acmds (playerid)", cmdtext, true, 10) == 0) //Remove from vehicle
 	{
 		if(IsPlayerAdmin(playerid))
 		{
			SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
			SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
			SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
			SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
			SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
      return 1;
 	  	}
 	  else
  	 {
			return 0;
			}
		}
	return 0;
}
i think it looks fine..


Re: Filterscript dosn't work? - adsy - 05.03.2010

Код:
                         //Remove from vehicle
if (strcmp("/acmds (playerid)", cmdtext, true, 10) == 0)
{
  if(IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
    SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
    SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
    SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
    SendClientMessage(playerid, COLOUR_YELLOW,"Text here");
    return 1;
  }
}
return 0;
}



Re: Filterscript dosn't work? - Naxix - 05.03.2010

Right now whatever i'm logged onto rcon or not it says "Server: Unknown Server Coammdn"


Re: Filterscript dosn't work? - adsy - 07.03.2010

try 1's on both and see if that helps