26.06.2018, 23:07
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(playerid, exception = INVALID_VEHICLE_ID)
{
new
Float: Distance, //WARNING LINE: 9077
target = -1,
Float: vPos[3];
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playerid, vPos[0], vPos[1], vPos[2]);
else GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
for(new v; v < MAX_VEHICLES; v++) if(GetVehicleModel(v) >= 400)
{
if(v != exception && (target < 0 || Distance > GetDistanceToCar(playerid, v, vPos[0], vPos[1], vPos[2])))
{
target = v;
Distance = GetDistanceToCar(playerid, v, vPos[0], vPos[1], vPos[2]); //ERROR LINE 9088
}
}
return target;
}
stock GetClosestGymTool(playerid, idx)
{
new Float:Distance, target = -1; //WARNING LINE:24613
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new s; s < MAX_GYMTOOL; s++)
{
if(target < 0 || Distance > GetDistanceToGymTool(playerid, idx, s, x, y, z))
{
target = s;
Distance = GetDistanceToGymTool(playerid, idx, s, x, y, z); //ERROR LINE 24621
}
}
return target;
}
=======================================================================
new Title[128]; //WARNING LINE:22699
format(Title, sizeof(Title), "{FFFFFF}Statistic - {33CCFF} %s", GetPlayerNameEx(targetid)); //ERROR LINE:22700
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, Title, str, "Ok", ""); //ERROR LINE:22701