FilterScript Fishing Problem
#1

Okay, I have this annoying problem, I am editing a FS for Fishing System, and everytime I type /fish it fishes but it gives this annoying message Invalid Command, any ideas?

Reply
#2

Make sure you have 'return 1;' at the end of your command.

It would also help to next time post the code.
Reply
#3

I got rid of the invalid command line when typing /fish by adding this to the script

if(strcmp(cmd,"/fish",true)==0)
{
tmp = strtok(cmdtext, idx,true);

return 1;
}

But now, I get /register [Password] while fishing.

Code:

if(strcmp(cmd, "/register", true) == 0)
{
tmp = strtok(cmdtext, idx,true);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /register [PASSWORD]");


Any ideas on how to get rid of these annoying messages by adding something to the script?
Reply
#4

Problem continues, any scripters have any idea what I should put in script so it allows the /fish command without giving an error message? Also can anyone create me a textdraw for my inventory part?


dcmd_inventory(playerid, params[])
{
#pragma unused params
new string[128];
SendClientMessage(playerid, COLOR_GREEN, "____|| Your inventory ||___");
if(Fishes[playerid]>0)
{
format(string,sizeof(string)," - %d fishes", Fishes[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
SendClientMessage(playerid, COLOR_GREEN, "___________________________");
return 1;
}
Reply
#5

Bump
Reply
#6

Try this without if(Fishes[playerid] > 0)
pawn Код:
dcmd_inventory(playerid, params[])
{
    #pragma unused params
    new string[128];
    SendClientMessage(playerid, COLOR_GREEN, "____|| Your inventory ||___");
    format(string,sizeof(string)," - %d fishes", Fishes[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return SendClientMessage(playerid, COLOR_GREEN, "___________________________");
}
Reply
#7

Still error message /register password when typing /fish
Code

I got rid of the invalid command line when typing /fish by adding this to the script

if(strcmp(cmd,"/fish",true)==0)
{
tmp = strtok(cmdtext, idx,true);

return 1;
}

But now, I get /register [Password] while fishing.

Code:

if(strcmp(cmd, "/register", true) == 0)
{
tmp = strtok(cmdtext, idx,true);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /register [PASSWORD]");
Reply
#8

dcmd_fish(playerid,params[])
{
#pragma unused params
new string[128];
new name[MAX_PLAYER_NAME];
if(IsPlayerInWater(playerid))
{
if(AlreadyFished[playerid] == 0 && IsFishing[playerid] == 0)
{
if(Fishes[playerid] >= 15)
{
SendClientMessage(playerid,COLOR_RED,"You have enough fish.");
SendClientMessage(playerid,COLOR_RED,"You can sell your fishes at Los Santos docks (/sellfish @ CheckPoint)");
AlreadyFished[playerid] = 1;
SetPlayerCheckpoint(playerid, 2766.6602,-2575.1614,3.0000,3.0);
SetTimerEx("StopFish", 1000*60*10, 0, "i",playerid);
}
else
{
new random2 = randomEx(4000,14000);
IsFishing[playerid] = 1;
SetTimerEx("FishTime", random2, 0, "i",playerid);
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s swings fishing rod and waits for fish",name);
SendRPMessage(playerid, 20.0, COLOR_PURPLE, string);
GameTextForPlayer(playerid, "~w~Fishing...",random2,3);
TogglePlayerControllable(playerid, true);
}
}
else

I get the invalid command again, heres the code from my gamemode



if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, "Invalid transaction amount.");
}
}
else {
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}



Any way to stop this message from appearing when I type /fish?

if(strcmp(cmd,"/fish",true)==0)
{
tmp = strtok(cmdtext, idx,true);

return 1;
}

I added this before and it stopped the Invalid Command from coming up but it did make /Register [Password]
come up


if(strcmp(cmd, "/register", true) == 0)
{
tmp = strtok(cmdtext, idx,true);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /register [PASSWORD]");
Here is the code from gamemode
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)