[ '/weaps' ] Command problem.
#1

Hello there guys. I have a little problem with '/weaps' command.
This command since yesterday is making me some problems.
The problem is that, it is crashing my server.
And in server log appears this:

SERVER LOG:
PHP код:
[19:18:58] [debug] AMX backtrace:
[
19:18:58] [debug] #0 00000065 in ?? (... <28 arguments>) at C:\Users\User\Dropbox\Server\IS\pawno\include\float.inc:102
[19:18:58] [debug] #1 00000065 in public cmd_weaps () at C:\Users\User\Dropbox\Server\IS\pawno\include\float.inc:102
[19:18:58] [debug] #2 native CallLocalFunction () [080dfac0] from samp03svr
[19:18:58] [debug] #3 000087c8 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x0046b264 "/weaps 14") at C:\Users\User\Dropbox\Server\IS\pawno\include\zcmd.inc:108 
COMMAND: '/WEAPS'.
PHP код:
CMD:weaps( playerid, params[ ] )
{
       
CheckLevel( playerid, 2 );
    new 
Player, Weapon, Ammo, WeaponName[ 20 ];
    if( 
sscanf( params, "u", Player ) )
    {
           
SendUsage( playerid, "/weaps [Player ID]" );
           return 
1;
    }
    else
    {
        if( 
Player == INVALID_PLAYER_ID )
            return 
SendError( playerid, "This player is not connected !" );
        new 
Title_String[ 5000 ];
        if( 
Player != playerid ) format( Title_String, sizeof( Title_String ), "{%06x}%s(%d) {FFFFFF}weapons:", GetPlayerColor( Player ) >>> 8, PlayerName( Player ), Player );
        else 
Title_String = "{FFFFFF}My weapons:";
        
eString[ 0 ] = EOS;
           
eString = "{FFFFFF}ID\t{FFFFFF}Weapon Name\t{FFFFFF}Ammo\n";
        for( new 
w = 0; w < 9; w++ )
        {
            
GetPlayerWeaponData( Player, w, Weapon, Ammo );
            if( 
Ammo < 0 ) Ammo = 9999;
            if( 
Weapon != 0 )
            {
                
GetWeaponName( Weapon, WeaponName[ w ], 20 );
                
format( eString, sizeof( eString ), "{FFFFFF}%s\t%d\t{FFFF55}%s\t{C0C0C0}%d\n", eString, w, WeaponName[ w ], Ammo );
            }
        }
        
ShowPlayerDialog( playerid, EMPTY_DIALOG, DIALOG_STYLE_TABLIST_HEADERS, Title_String, eString, "Ok", "" );
}
     return 
1;
} 
If you you guys know how to fix it, please reply.
Reply
#2

Is that whole crashlog? I dont see error line.
Reply
#3

Yea it is. The line don't appear idk why, i already have -d3 flag.
Reply
#4

Guys ?
Reply
#5

format these
> else Title_String = "{FFFFFF}My weapons:";

format( ..., sizeof(...), .. ); etc
Reply
#6

Код:
COMMAND:weaps(playerid, params[])
{
	new t_string[128], d_string[128];
	new giveplayerid, ammo, weaponid, weapon[24];
	
	if(sscanf(params, "D(-1)", giveplayerid))
		return SendUsage(playerid, "/weaps <player ID>");

	giveplayerid = (giveplayerid == -1) ? playerid : giveplayerid;

	if(!IsPlayerConnected(giveplayerid))
		return SendError(playerid, "This player is not connected!");

	if(playerid != giveplayerid) format(t_string, sizeof(t_string), "{%06x}%s(%d) {FFFFFF}weapons:", GetPlayerColor(giveplayerid) >>> 8, PlayerName(giveplayerid), giveplayerid);
	else t_string = format(t_string, sizeof(t_string), "{FFFFFF}My weapons:");

    format(d_string, sizeof(d_string), "");
    format(d_string, sizeof(d_string), "%s{FFFFFF}ID\t{FFFFFF}Weapon Name\t{FFFFFF}Ammo\n", d_string);

    for(new j; j < 9; j++)
    {
        GetPlayerWeaponData(giveplayerid, j, weaponid, ammo);

        if (ammo < 0) ammo = 9999;
        if (weaponid != 0)
        {
            GetWeaponName(weaponid, weapon[j], 24);
            format(d_string, sizeof(d_string), "%s{FFFFFF}%s\t%d\t{FFFF55}%s\t{C0C0C0}%d\n", d_string, j, weapon[j], ammo);
        }
    }
    ShowPlayerDialog(playerid, EMPTY_DIALOG, DIALOG_STYLE_TABLIST_HEADERS, t_string, d_string, "Ok", "");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)