Need help fixing error error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help fixing error error (
/showthread.php?tid=106542)
Need help fixing error error -
Jose 510 - 03.11.2009
Код:
(3989) : warning 209: function "SetPlayerFightStyle" should return a value
(3990) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
public SetPlayerFightStyle(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFightStyle] == 1)//Kick_Boxinng
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
}
else if(PlayerInfo[playerid][pFightStyle] == 2)//Kung_Fu
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
}
else if(PlayerInfo[playerid][pFightStyle] == 3)//Boxing
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
}
else if(PlayerInfo[playerid][pFightStyle] == 4)//Street_Fight
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
}
}
} <----line 3389
return 1; <----line 3390
}
Re: Need help fixing error error -
Alice[WS] - 03.11.2009
Код:
public SetPlayerFightStyle(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFightStyle] == 1)//Kick_Boxinng
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
return 1;
}
else if(PlayerInfo[playerid][pFightStyle] == 2)//Kung_Fu
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
return 1;
}
else if(PlayerInfo[playerid][pFightStyle] == 3)//Boxing
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
return 1;
}
else if(PlayerInfo[playerid][pFightStyle] == 4)//Street_Fight
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
return 1;
}
// } delete this ligne
}
return 1;
}
Re: Need help fixing error error -
Jose 510 - 03.11.2009
Ok, I some of it so now it looks like this. I haven't tested this and got no warnings, but will it work?
Код:
public SetPlayerFightStyle(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFightStyle] == 1)//Kick_Boxinng
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
}
else if(PlayerInfo[playerid][pFightStyle] == 2)//Kung_Fu
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
}
else if(PlayerInfo[playerid][pFightStyle] == 3)//Boxing
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
}
else if(PlayerInfo[playerid][pFightStyle] == 4)//Street_Fight
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
}
}
return 1;
}