SA-MP Forums Archive
Problem in stock CPS_AddCheckpoint - 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: Problem in stock CPS_AddCheckpoint (/showthread.php?tid=273766)



Problem in stock CPS_AddCheckpoint - ™BilaBonG™ - 03.08.2011

Hello and Good morning
I have a problem Struck CPS_AddCheckpoint

Wornings:
PHP код:
C:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "X" shadows a variable at a preceding level
C
:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "Y" shadows a variable at a preceding level
C
:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "Z" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
3 Warnings

lines:

PHP код:
stock CPS_AddCheckpoint(Float:X,Float:Y,Float:Z,Float:size,spawn_dist)
{
    new 
cpid=1;
    while(
UsedCPSlot[cpid] == 1cpid++;
    if(
CPSERVICE_active == 0){
        
SetTimer("CPSERVICE_Handler",500,true);
        
CPSERVICE_active=1;
    }
    
UsedCPSlot[cpid]=1;
    
Checkpoints[cpid][cpX]=X;
    
Checkpoints[cpid][cpY]=Y;
    
Checkpoints[cpid][cpZ]=Z;
    
Checkpoints[cpid][cpsz]=size;
    
Checkpoints[cpid][cpsd]=spawn_dist;
    return 
cpid;

Hope you help me


Re: Problem in stock CPS_AddCheckpoint - Shockey HD - 03.08.2011

Quote:
Originally Posted by ™BilaBonG™
Посмотреть сообщение
Hello and Good morning
I have a problem Struck CPS_AddCheckpoint

Wornings:
PHP код:
C:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "X" shadows a variable at a preceding level
C
:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "Y" shadows a variable at a preceding level
C
:\Users\ъойш\Desktop\samp03csvr_R5_win32\gamemodes\lvdm.pwn(5629) : warning 219local variable "Z" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
3 Warnings

lines:

PHP код:
stock CPS_AddCheckpoint(Float:X,Float:Y,Float:Z,Float:size,spawn_dist)
{
    new 
cpid=1;
    while(
UsedCPSlot[cpid] == 1cpid++;
    if(
CPSERVICE_active == 0){
        
SetTimer("CPSERVICE_Handler",500,true);
        
CPSERVICE_active=1;
    }
    
UsedCPSlot[cpid]=1;
    
Checkpoints[cpid][cpX]=X;
    
Checkpoints[cpid][cpY]=Y;
    
Checkpoints[cpid][cpZ]=Z;
    
Checkpoints[cpid][cpsz]=size;
    
Checkpoints[cpid][cpsd]=spawn_dist;
    return 
cpid;

Hope you help me
x,y,z are floats.


add new Float: x,Float:y,Float:z; somewhere in the stock.


Re: Problem in stock CPS_AddCheckpoint - Cameltoe - 03.08.2011

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
x,y,z are floats.


add new Float: x,Float:y,Float:z; somewhere in the stock.
No, the variable names already exists globally.

pawn Код:
stock CPS_AddCheckpoint(Float:cX,Float:cY,Float:cZ,Float:size,spawn_dist)
{
    new cpid=1;
    while(UsedCPSlot[cpid] == 1) cpid++;
    if(CPSERVICE_active == 0){
        SetTimer("CPSERVICE_Handler",500,true);
        CPSERVICE_active=1;
    }
    UsedCPSlot[cpid]=1;
    Checkpoints[cpid][cpX]=cX;
    Checkpoints[cpid][cpY]=cY;
    Checkpoints[cpid][cpZ]=cZ;
    Checkpoints[cpid][cpsz]=size;
    Checkpoints[cpid][cpsd]=spawn_dist;
    return cpid;
}



Re: Problem in stock CPS_AddCheckpoint - Shockey HD - 03.08.2011

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
No, the variable names already exists globally.

pawn Код:
stock CPS_AddCheckpoint(Float:cX,Float:cY,Float:cZ,Float:size,spawn_dist)
{
    new cpid=1;
    while(UsedCPSlot[cpid] == 1) cpid++;
    if(CPSERVICE_active == 0){
        SetTimer("CPSERVICE_Handler",500,true);
        CPSERVICE_active=1;
    }
    UsedCPSlot[cpid]=1;
    Checkpoints[cpid][cpX]=cX;
    Checkpoints[cpid][cpY]=cY;
    Checkpoints[cpid][cpZ]=cZ;
    Checkpoints[cpid][cpsz]=size;
    Checkpoints[cpid][cpsd]=spawn_dist;
    return cpid;
}
AH crap i didnt look at the Warning good enough /faceplam sorry.


Re: Problem in stock CPS_AddCheckpoint - ™BilaBonG™ - 03.08.2011

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
No, the variable names already exists globally.

pawn Код:
stock CPS_AddCheckpoint(Float:cX,Float:cY,Float:cZ,Float:size,spawn_dist)
{
    new cpid=1;
    while(UsedCPSlot[cpid] == 1) cpid++;
    if(CPSERVICE_active == 0){
        SetTimer("CPSERVICE_Handler",500,true);
        CPSERVICE_active=1;
    }
    UsedCPSlot[cpid]=1;
    Checkpoints[cpid][cpX]=cX;
    Checkpoints[cpid][cpY]=cY;
    Checkpoints[cpid][cpZ]=cZ;
    Checkpoints[cpid][cpsz]=size;
    Checkpoints[cpid][cpsd]=spawn_dist;
    return cpid;
}
ty but i used pX,pY,pZ and working !!
ty bro


Re: Problem in stock CPS_AddCheckpoint - Cameltoe - 03.08.2011

You could name it bilabongX, bilabongY, bilabongZ And it wouldnt matter, it's just variable names.


Re: Problem in stock CPS_AddCheckpoint - ™BilaBonG™ - 03.08.2011

yes i know , ty bro's for nice help !