Several Warnings
#1

Dunno where they came from or how to fix them:
pawn Код:
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(474) : warning 219: local variable "pox" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(474) : warning 219: local variable "poy" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(474) : warning 219: local variable "poz" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(481) : warning 219: local variable "markx" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(481) : warning 219: local variable "marky" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(481) : warning 219: local variable "markz" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(481) : warning 219: local variable "distance" shadows a variable at a preceding level
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(483) : warning 209: function "IsPlayerCloseToMarker" should return a value
C:\Documents and Settings\Liat.LIAT-5FBA01523F\Desktop\My Folder\Games\Grand Theft Auto San Andreas\Pawno\X-Missions Server\gamemodes\Italian Cafe.pwn(488) : warning 203: symbol is never used: "string"
Warning Lines:
pawn Код:
forward Float:GetDistanceBetweenPlayerToPoint(playerid,Float:pox,Float:poy,Float:poz);
public Float:GetDistanceBetweenPlayerToPoint(playerid,Float:pox,Float:poy,Float:poz) {
    new Float:pox,Float:poy,Float:poz,Float:plax,Float:play,Float:plaz;
    if(!IsPlayerConnected(playerid)) { return -1.00; }
    GetPlayerPos(playerid,plax,play,plaz);
    return floatsqroot(floatpower(floatabs(floatsub(plax,pox)),2)+floatpower(floatabs(floatsub(play,poy)),2)+floatpower(floatabs(floatsub(plaz,poz)),2)); }

forward IsPlayerCloseToMarker(playerid,Float:markx,Float:marky,Float:markz,Float:distance);
public IsPlayerCloseToMarker(playerid,Float:markx,Float:marky,Float:markz,Float:distance) {
    new Float:markx,Float:marky,Float:markz,Float:distance;
    if(GetDistanceBetweenPlayerToPoint(playerid,markx,marky,markz) < distance) { return true; }
    else if(GetDistanceBetweenPlayerToPoint(playerid,markx,marky,markz) > distance) { return false; } }
Please help
Reply
#2

try to delete all the new vars that you created that gives an error
and there is no return in "IsPlayerCloseToMarker" after the if then else statement.
Reply
#3

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
try to delete all the new vars that you created that gives an error
and there is no return in "IsPlayerCloseToMarker" after the if then else statement.
But I need to put values in this vars..
Reply
#4

pawn Код:
public Float:GetDistanceBetweenPlayerToPoint(playerid,Float:pox,Float:poy,Float:poz) // already defined here
pawn Код:
newFloat:plax,Float:play,Float:plaz; // this is what you need
Reply
#5

You simply created the same variables twice somewhere.
Reply
#6

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
pawn Код:
public Float:GetDistanceBetweenPlayerToPoint(playerid,Float:pox,Float:poy,Float:poz) // already defined here
pawn Код:
newFloat:plax,Float:play,Float:plaz; // this is what you need
Quote:
Originally Posted by Drebin
Посмотреть сообщение
You simply created the same variables twice somewhere.
Fixed,what else?
Reply
#7

Quote:
Originally Posted by nuriel8833
Посмотреть сообщение
Fixed,what else?
Well, what errors do you still have?
Reply
#8

Quote:
Originally Posted by Drebin
Посмотреть сообщение
Well, what errors do you still have?
pawn Код:
warning 209: function "IsPlayerCloseToMarker" should return a value
+Every usage of the "IsPlayerCloseToMarker" function gives me the "tag mismatch" warning
Reply
#9

Try this:
pawn Код:
forward IsPlayerCloseToMarker(playerid,Float:markx,Float:marky,Float:markz,Float:distance);
public IsPlayerCloseToMarker(playerid,Float:markx,Float:marky,Float:markz,Float:distance) {
    new Float:markx,Float:marky,Float:markz,Float:distance;
    if(GetDistanceBetweenPlayerToPoint(playerid,markx,marky,markz) < distance) { return 1; }
    else if(GetDistanceBetweenPlayerToPoint(playerid,markx,marky,markz) > distance) { return 0; }
    return 0;
}
It should remove those 2 warnings.
Reply
#10

pawn Код:
stock bool:IsPlayerCloseToMarker( playerid, Float:markx, Float:marky, Float:markz, Float:distance )
{
    if ( GetDistanceBetweenPlayerToPoint( playerid, markx, marky, markz ) < distance ) return(true);
    else return(false);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)