07.06.2012, 09:17
Problem
I have a return?
Код:
../gamemodes/OnPlayerCommandZCMD.pwn(3095) : warning 209: function "cmd_fish" should return a value ../gamemodes/OnPlayerCommandZCMD.pwn(3096) : error 010: invalid function or declaration ../gamemodes/OnPlayerCommandZCMD.pwn(3100) : error 010: invalid function or declaration
pawn Код:
}
COMMAND:fish(playerid, params[])
{
if(IsAtFishPlace(playerid))
{
if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
if(JustFished[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Please wait 4 seconds between each /fish. ");
return 1;
}
if(PlayerInfo[playerid][pFish] == 20)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You can not carry anymore fish use /sellfish");
return 1;
}
JustFished[playerid] = 1;
SetTimerEx("FishReset", 4000, false, "i", playerid);
new FishRand = random(9);
if(FishRand == 0)
{
PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Pike");
PlayerInfo[playerid][pFish] += 1;
}
if(FishRand == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
}
if(FishRand == 2)
{
PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Sardine");
PlayerInfo[playerid][pFish] += 1;
}
if(FishRand == 3)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
}
if(FishRand == 4)
{
PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Sardine");
PlayerInfo[playerid][pFish] += 1;
}
if(FishRand == 5)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
}
if(FishRand == 6)
{
PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Bass");
PlayerInfo[playerid][pFish] += 1;
}
if(FishRand == 7)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
}
if(FishRand == 8)
{
PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Bass");
PlayerInfo[playerid][pFish] += 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
return 1;
}