Filterscript dosn't work?
#1

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
Reply
#2

did you load the filterscripts?

Use loadfs then the script name in rcon

also return 0 at the end of onplayercommandtext in both scripts
Reply
#3

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?
Reply
#4

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;
}
Reply
#5

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..
Reply
#6

Код:
                         //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;
}
Reply
#7

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

try 1's on both and see if that helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)