Fish bug, simple
#1

I made this fish command

Код:
if(strcmp("/pecaj", cmdtext, true, 10) == 0)
  {
    if(spamblocker4[playerid] == 1 ) return SendClientMessage(playerid ,0xFF0000FF, "Moras pricekati neko vrijeme prije nego opet koristis ovu komandu.");
    else
    if(IsPlayerInVehicle(playerid, 472) && IsPlayerInVehicle(playerid, 473) && IsPlayerInVehicle(playerid, 493) && IsPlayerInVehicle(playerid, 595) && IsPlayerInVehicle(playerid, 484) && IsPlayerInVehicle(playerid, 430) && IsPlayerInVehicle(playerid, 453) && IsPlayerInVehicle(playerid, 452) && IsPlayerInVehicle(playerid, 446) && IsPlayerInVehicle(playerid, 454)) return SendClientMessage(playerid,0x00FF00AA,"Moras biti u brodu!");
    {
      spamblocker4[playerid] = 1;
      SetTimerEx("Pecanje", 10000, false, "d",playerid);
      ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Pecanje","Pricekaj 10 sekundi dok ne upecas!","OK","Odustani");
    }
    return 1;
  }
that is command for fish and when i am on foot its say "You must be on boat" < and that is correctly but if i am in boat its say again i must be in boat -.- can somebody find the problem i try to remove >!< before IsPlayerInVehicle but its dosent work :/
Reply
#2

piece of cake:
Код:
    if(IsPlayerInVehicle(playerid, 472) || IsPlayerInVehicle(playerid, 473) || IsPlayerInVehicle(playerid, 493) || IsPlayerInVehicle(playerid, 595) || IsPlayerInVehicle(playerid, 484) || IsPlayerInVehicle(playerid, 430) || IsPlayerInVehicle(playerid, 453) || IsPlayerInVehicle(playerid, 452) || IsPlayerInVehicle(playerid, 446) || IsPlayerInVehicle(playerid, 454)) return SendClientMessage(playerid,0x00FF00AA,"Moras biti u brodu!");
you simply checked for the player being in all boats at a time (&& = AND) instead of checking for only one (|| = OR).
iam not sure about the return at the end, i guess you already did the "put a fish into inventory" thing?
Reply
#3

Quote:
Originally Posted by Babul
piece of cake:
Код:
    if(IsPlayerInVehicle(playerid, 472) || IsPlayerInVehicle(playerid, 473) || IsPlayerInVehicle(playerid, 493) || IsPlayerInVehicle(playerid, 595) || IsPlayerInVehicle(playerid, 484) || IsPlayerInVehicle(playerid, 430) || IsPlayerInVehicle(playerid, 453) || IsPlayerInVehicle(playerid, 452) || IsPlayerInVehicle(playerid, 446) || IsPlayerInVehicle(playerid, 454)) return SendClientMessage(playerid,0x00FF00AA,"Moras biti u brodu!");
you simply checked for the player being in all boats at a time (&& = AND) instead of checking for only one (|| = OR).
iam not sure about the return at the end, i guess you already did the "put a fish into inventory" thing?
This is better but now if im on foot it say "Wait 10 sec to cach something" < i cant fish if im on foot Oo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)