i've searched it on ******,i've deleted the new string,renamed,but,the same problem."local variable "string" shadows a variable at a preceding level"; that line is this one,new string[1024] if(strcmp(cmd, "/vhelp", true) == 0)
{
new string[1024];
if(PlayerInfo[playerid][pVIP] >= 1)return SendClientMessage(playerid, red, "You must have a V.I.P. Account to use this command! ");
{
strcat( string, "{FFD700}/vhelp\t\t\t{FFD700}/vrespawn\n" );
strcat( string, "{FFD700}/vips\t\t\t{FFD700}/vgoto\n" );
strcat( string, "{FFD700}/vnos\t\t\t{FFD700}/vgethere\n" );
strcat( string, "{FFD700}/sultantune\t\t{FFD700}/vweapons\n" );
strcat( string, "{FFD700}/jestertune\t\t{FFD700}/vammo\n" );
strcat( string, "{FFD700}/elegytune\t\t{FFD700}/vclub\n" );
strcat( string, "{FFD700}/othertune\n" );
strcat( string, "{FFD700}Use '/vc' in front of text.This is the V.I.P. chat." );
ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P. Commands:", string, "Quit", "" );
}
return 1;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
new string[ 128 ]; // 1st string
if(strcmp(cmd, "/vhelp", true) == 0)
{
new string[1024]; //2nd string
if(PlayerInfo[playerid][pVIP] >= 1)return SendClientMessage(playerid, red, "You must have a V.I.P. Account to use this command! ");
{
strcat( string, "{FFD700}/vhelp\t\t\t{FFD700}/vrespawn\n" );
strcat( string, "{FFD700}/vips\t\t\t{FFD700}/vgoto\n" );
strcat( string, "{FFD700}/vnos\t\t\t{FFD700}/vgethere\n" );
strcat( string, "{FFD700}/sultantune\t\t{FFD700}/vweapons\n" );
strcat( string, "{FFD700}/jestertune\t\t{FFD700}/vammo\n" );
strcat( string, "{FFD700}/elegytune\t\t{FFD700}/vclub\n" );
strcat( string, "{FFD700}/othertune\n" );
strcat( string, "{FFD700}Use '/vc' in front of text.This is the V.I.P. chat." );
ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P. Commands:", string, "Quit", "" );
}
return 1;
}
return 0;
}
// Result: local variable "string" shadows a variable at a preceding level
string[1024]
string[128]
if(strcmp(cmd, "/vhelp", true) == 0)
{
new GMstring[128];
if(PlayerInfo[playerid][pVIP] >= 1)return SendClientMessage(playerid, red, "You must have a V.I.P. Account to use this command! ");
{
strcat( GMstring, "{FFD700}/vhelp\t\t\t{FFD700}/vrespawn\n" );
strcat( GMstring, "{FFD700}/vips\t\t\t{FFD700}/vgoto\n" );
strcat( GMstring, "{FFD700}/vnos\t\t\t{FFD700}/vgethere\n" );
strcat( GMstring, "{FFD700}/sultantune\t\t{FFD700}/vweapons\n" );
strcat( GMstring, "{FFD700}/jestertune\t\t{FFD700}/vammo\n" );
strcat( GMstring, "{FFD700}/elegytune\t\t{FFD700}/vclub\n" );
strcat( GMstring, "{FFD700}/othertune\n" );
strcat( GMstring, "{FFD700}Use '/vc' in front of text.This is the V.I.P. chat." );
ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P. Commands:", string, "Quit", "" );
}
return 1;
}
|
SOLVED,it's right?... i've compiled it and i dont have any warnings,errors
pawn Код:
|
|
SOLVED,it's right?... i've compiled it and i dont have any warnings,errors
pawn Код:
|
|
Holy shit. Don't use
pawn Код:
pawn Код:
|
|
He needs more than 128, he's using strcat so the size is going to be greater than 128.
|