[HELP] Two annoying warnings - 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: [HELP] Two annoying warnings (
/showthread.php?tid=87791)
[HELP] Two annoying warnings -
FreddeN - 22.07.2009
As I said in another post, I'm having toruble with my register system, I have alot of warnings that I dont got time to fix.
Now I'm trying to fix them, it maybe fixes the reister problem...
Anyway, I got two warnings left I dont understand.
Code:
public function lacks forward declaration (symbol "SetPlayerUnjail")
Code:
public function lacks forward declaration (symbol "PlayerToPoint")
First warning comes from:
Code:
public SetPlayerUnjail()
{
//new plname[MAX_PLAYER_NAME];
//new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime]--;
}
if(PlayerInfo[i][pJailTime] <= 0)
{
PlayerInfo[i][pJailTime] = 0;
if(PlayerInfo[i][pJailed] == 1)
{
SetPlayerInterior(i, 6);
SetPlayerPos(i,264.6288,77.5742,1001.0391);
}
else if(PlayerInfo[i][pJailed] == 2)
{
SetPlayerInterior(i, 6);
SetPlayerPos(i,264.6288,77.5742,1001.0391);
}
PlayerInfo[i][pJailed] = 0;
SendClientMessage(i, COLOR_RED,"You have completed your jail time, be good now!");
SetPlayerInterior(i, 0);
SetPlayerPos(i,1542.8196,-1675.5737,13.5552);
}
}
}
}
Second Warning:
Code:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
Thanks
Re: [HELP] Two annoying warnings -
James_Alex - 22.07.2009
use
pawn Code:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
and
pawn Code:
forward SetPlayerUnjail();
in the top of the script
Re: [HELP] Two annoying warnings -
Donny_k - 22.07.2009
If they are not being called remotely and are not being fired by timers then remove the 'public'.