[Help] How can i fix this warning
#1

Код:
C:\Dokumente und Einstellungen\Ab\Desktop\Ver3\gamemodes\Gamemode.pwn(6089) : warning 219: local variable "x" shadows a variable at a preceding level
Reply
#2

Delete new Float: x; or what is it at Line 6089 and use another Variable
Reply
#3

Delete the declaration of 'x' in the function.
Something like this:
pawn Код:
new Float:x
Reply
#4

Код:
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	switch(IsPlayerInAnyVehicle(playerid))
	{
	    case 0: GetPlayerFacingAngle(playerid, a);
	    case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
	return a;
}
so i change x to F and y to G example ? and then i must change all lines wich using the function ( GetPosInFrontOfPlayer )
Reply
#5

Quote:
Originally Posted by Jimbo01
Посмотреть сообщение
so i change x to F and y to G example ? and then i must change all lines wich using the function ( GetPosInFrontOfPlayer )
No.
Just delete the
pawn Код:
new Float:x;
because it has been already defined somewhere in your script.
Reply
#6

thanks but i dont have new float: x;

the error line is this

stock Float:GetPosInFrontOfPlayer(playerid, &Float, &Float:y, Float:distance)

what should i remove ?
Reply
#7

Remove the Float: infront of getposinfrontofplayer.

rename the &Float: x to something like Float:gX , Float:gY and on and on.

And yes, you must replace others too, not just on the stock().
It wont take long, just do it. Better than waiting for a response for 15 minutes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)