A Little warning
#1

Hello,
I am getting this warning.
beta.pwn(4336) : warning 203: symbol is never used: "playerid" .

and here is the line, 4336.

Код:
stock IsNearATM(playerid)
{
    new bool:IsClose = false;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 1.0, -1867.30005, 943.35999, 34.80000))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -1622.09998, 716.82001, 14.24000))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -2450.19995, 755.59998, 34.80000))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -2727.46777, 388.97891, 4.00720))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -2638.05371, 635.36920, 14.07310))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -1939.57678, 265.36539, 40.66030))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -1764.69995, 1084.00000, 45.10000))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
        else if(IsPlayerInRangeOfPoint(i, 1.0, -1493.13049, 930.49518, 6.81230))  //Checking if player close to first/only ATm we created.
        {
            IsClose = true;
        }
    }
    return IsClose;
}
I don't want to remove the playerid, because it is being used, but in different function.
I mean, the function is in a include of this gamemode.
Reply
#2

PHP код:
stock IsNearATM(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid1.0, -1867.30005943.3599934.80000) || IsPlayerInRangeOfPoint(playerid1.0, -1622.09998716.8200114.24000) || IsPlayerInRangeOfPoint(playerid1.0, -2450.19995755.5999834.80000) ||
       
IsPlayerInRangeOfPoint(playerid1.0, -2727.46777388.978914.00720) || IsPlayerInRangeOfPoint(playerid1.0, -2638.05371635.3692014.07310) || IsPlayerInRangeOfPoint(playerid1.0, -1939.57678265.3653940.66030) ||
       
IsPlayerInRangeOfPoint(playerid1.0, -1764.699951084.0000045.10000) || IsPlayerInRangeOfPoint(playerid1.0, -1493.13049930.495186.81230))
    { 
//Checking if player close to first/only ATm we created.
        
return 1;
    }
    return 
0;

Reply
#3

It is not being used within this function. This checks if ANY player is close, rather than just the single player. Remove the loop and replace i with playerid. And to clean up the code you can use arrays.

PHP код:
IsNearATM(playerid, &Float:locX 0, &Float:locY 0, &Float:locZ 0)
{
    static const 
Float:atmLocations[][3] = {
        {-
1867.30005943.3599934.80000},
        {-
1622.09998716.8200114.24000},
        {-
2450.19995755.5999834.80000},
        {-
2727.46777388.97891,  4.00720},
        {-
2638.05371635.3692014.07310},
        {-
1939.57678265.3653940.66030},
        {-
1764.699951084.000045.10000},
        {-
1493.13049930.49518,  6.81230}
    }; 
    
    for(new 
isizeof(atmLocations); i++)
    {
        if(
IsPlayerInRangeOfPoint(playerid1.0atmLocations[i][0], atmLocations[i][1], atmLocations[i][2])
        {
            
locX atmLocations[i][0];
            
locY atmLocations[i][1];
            
locZ atmLocations[i][2];
            return 
true;
        }
    }
    
    return 
false;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)