16.02.2013, 15:53
Hello.
I have a problem with variables in dialogs. I have dialog with id 136 and this code if player press response:
Then dialog with id 143 with exactly same code undder !response.
But if I want to compile .pwn file I get errors:
Can someone tell me why I'm getting these errors?
I know, I can just change variable names, but I can't understand why I'm getting these errors, because variables are created in certain dialogs?
P.S. All brackets are closed! And if I disable this code in 136'th dialog, mod compiles sucessfully.
I have a problem with variables in dialogs. I have dialog with id 136 and this code if player press response:
PHP код:
new
header[ 70 ];
if ( !privatDB[ playerid ][ Sunaikinta ] )
{
new
engine, lights, alarm, doors, bonnet, boot, objective,
stringas[ 2 ][ 30 ], formatas[ 128 ], Float:vh;
GetVehicleParamsEx( privatDB[ playerid ][ pID ], engine, lights, alarm, doors, bonnet, boot, objective );
if ( doors ) stringas[ 0 ] = "{FF0000}Atrakinti duris"; else stringas[ 0 ] = "{00FF00}Uzrakinti duris";
if ( !boot ) stringas[ 1 ] = "{FF0000}Atidaryti bagazine"; else stringas[ 1 ] = "{00FF00}Uzdaryti bagazine";
GetVehicleHealth( privatDB[ playerid ][ pID ], vh );
if ( vh >= 750.0 )
format( header, sizeof header, "%s valdymas - Health: {00FF00}%.0f%%", aVehicleNames[ GetVehicleModel( privatDB[ playerid ][ pID ] ) - 400 ], vh/10 );
else if ( vh >= 500.0 )
format( header, sizeof header, "%s valdymas - Health: {f5db00}%.0f%%", aVehicleNames[ GetVehicleModel( privatDB[ playerid ][ pID ] ) - 400 ], vh/10 );
else
format( header, sizeof header, "%s valdymas - Health: {ff0000}%.0f%%", aVehicleNames[ GetVehicleModel( privatDB[ playerid ][ pID ] ) - 400 ], vh/10 );
format( formatas, sizeof formatas, "%s\nKur mano transp.?\n%s\nParduoti transp.", stringas[ 0 ], stringas[ 1 ] );
ShowPlayerDialog( playerid, 136, DIALOG_STYLE_LIST, header, formatas, "Rinktis", "Uzdaryti" );
}else{
format( header, sizeof header, "%s valdymas - {FF0000}SUDAUZYTA", aVehicleNames[ privatDB[ playerid ][ pModelis ] - 400 ] );
ShowPlayerDialog( playerid, 137, DIALOG_STYLE_LIST, header, "Sutaisyti transp.\nParduoti transp.", "Rinktis", "Uzdaryti" );
}
But if I want to compile .pwn file I get errors:
Код:
C:\Users\Gin\Desktop\Cyberplay server\Modas\gamemodes\GM.pwn(13203) : error 021: symbol already defined: "header" C:\Users\Gin\Desktop\Cyberplay server\Modas\gamemodes\GM.pwn(13208) : error 021: symbol already defined: "engine"
I know, I can just change variable names, but I can't understand why I'm getting these errors, because variables are created in certain dialogs?
P.S. All brackets are closed! And if I disable this code in 136'th dialog, mod compiles sucessfully.