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