Help Meeee.. 4 Errors!
#1

I just included <MV_Youtube> and after that I get 4 error and some warnings .. what is wrong with this code guys?

Code:
d:\SAMPSERVER\samp03\gamemodes\a.pwn(9088) : error 022: must be lvalue (non-constant)
d:\SAMPSERVER\samp03\gamemodes\a.pwn(22700) : error 035: argument type mismatch (argument 1)
d:\SAMPSERVER\samp03\gamemodes\a.pwn(22701) : error 035: argument type mismatch (argument 4)
d:\SAMPSERVER\samp03\gamemodes\a.pwn(24621) : error 022: must be lvalue (non-constant)
d:\SAMPSERVER\samp03\gamemodes\a.pwn(9077) : warning 219: local variable "Distance" shadows a variable at a preceding level
d:\SAMPSERVER\samp03\gamemodes\a.pwn(9077) : warning 203: symbol is never used: "Distance"
d:\SAMPSERVER\samp03\gamemodes\a.pwn(22699) : warning 219: local variable "Title" shadows a variable at a preceding level
d:\SAMPSERVER\samp03\gamemodes\a.pwn(22699) : warning 204: symbol is assigned a value that is never used: "Title"
d:\SAMPSERVER\samp03\gamemodes\a.pwn(24613) : warning 219: local variable "Distance" shadows a variable at a preceding level
d:\SAMPSERVER\samp03\gamemodes\a.pwn(24613) : warning 203: symbol is never used: "Distance"
PHP Code:
stock GetClosestCar(playeridexception INVALID_VEHICLE_ID)
{
    new
        
FloatDistance//WARNING LINE: 9077
        
target = -1,
        
FloatvPos[3];
    if(!
IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playeridvPos[0], vPos[1], vPos[2]);
    else 
GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
    for(new 
vMAX_VEHICLESv++) if(GetVehicleModel(v) >= 400)
    {
        if(
!= exception && (target || Distance GetDistanceToCar(playeridvvPos[0], vPos[1], vPos[2])))
        {
            
target v;
            
Distance GetDistanceToCar(playeridvvPos[0], vPos[1], vPos[2]); //ERROR LINE 9088
        
}
    }
    return 
target;
}
stock GetClosestGymTool(playerididx)
{
    new 
Float:Distancetarget = -1//WARNING LINE:24613
    
new Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    for(new 
sMAX_GYMTOOLs++)
    {
        if(
target || Distance GetDistanceToGymTool(playerididxsxyz))
        {
            
target s;
            
Distance GetDistanceToGymTool(playerididxsxyz); //ERROR LINE 24621
        
}
    }
    return 
target;
}
=======================================================================
new 
Title[128]; //WARNING LINE:22699
format(Titlesizeof(Title), "{FFFFFF}Statistic - {33CCFF} %s"GetPlayerNameEx(targetid)); //ERROR LINE:22700
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOXTitlestr"Ok"""); //ERROR LINE:22701 
Reply
#2

And when I try not to include <MV_Youtube> the errors and the warning is gone
Reply
#3

dont use MV_Youtube it contains those variables and MV_Youtube doesn't even work.
Reply
#4

You need to change the variable name because its already defined
try this
PHP Code:
stock GetClosestCar(playeridexception INVALID_VEHICLE_ID

    new 
        
FloatDistance1//WARNING LINE: 9077 
        
target = -1
        
FloatvPos[3]; 
    if(!
IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playeridvPos[0], vPos[1], vPos[2]); 
    else 
GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]); 

    for(new 
vMAX_VEHICLESv++) if(GetVehicleModel(v) >= 400
    { 
        if(
!= exception && (target || Distance1 GetDistanceToCar(playeridvvPos[0], vPos[1], vPos[2]))) 
        { 
            
target v
            
Distance1 GetDistanceToCar(playeridvvPos[0], vPos[1], vPos[2]); //ERROR LINE 9088 
        

    } 
    return 
target


stock GetClosestGymTool(playerididx

    new 
Float:Distance1target = -1//WARNING LINE:24613 
    
new Float:xFloat:yFloat:z
    
GetPlayerPos(playeridxyz); 
    for(new 
sMAX_GYMTOOLs++) 
    { 
        if(
target || Distance1 GetDistanceToGymTool(playerididxsxyz)) 
        { 
            
target s
            
Distance1 GetDistanceToGymTool(playerididxsxyz); //ERROR LINE 24621 
        

    } 
    return 
target

======================================================================= 
new 
Title1[128]; //WARNING LINE:22699 
format(Title1sizeof(Title1), "{FFFFFF}Statistic - {33CCFF} %s"GetPlayerNameEx(targetid)); //ERROR LINE:22700 
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOXTitle1str"Ok"""); //ERROR LINE:22701 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)