weird bug / crash by native SendClientMessage
#1

weird? Look backtrace...


Quote:

[10/08/12 16:48:30] [debug] Server crashed while executing BSL2.amx

[10/08/12 16:48:30] [debug] Backtrace:

[10/08/12 16:48:30] [debug] #0 native SendClientMessage () from bsl

[10/08/12 16:48:30] [debug] #1 000ff214 in public ProxDetector (Float:radi=30.00000, playerid=9, string[]=@0x0008b018 "Easy_Job trocou a r", col1=-1029514497, col2=-1029514497, col3=-1029514497, col4=-1029514497, col5=-1029514497) at C:\BSL\BSL 2.1\gamemodes\BSL2.pwn:8473

[10/08/12 16:48:30] [debug] #2 00094098 in public QdoResponderDialogNikoRadio (playerid=9, dialogid=88, response=1, listitem=95, inputtext[]=@0x0095af50 "") at Radio_System.pwn:84

[10/08/12 16:48:30] [debug] #3 00329794 in public S@@_OnDialogResponse (playerid=9, dialogid=88, response=1, listitem=95, inputtext[]=@0x0095af50 "", ... <1 variable argument>) at C:\BSL\BSL 2.1\gamemodes\BSL2.pwn:42901

[10/08/12 16:48:30] [debug] #4 native CallLocalFunction () from bsl

[10/08/12 16:48:30] [debug] #5 0001b730 in public OnDialogResponse (playerid=9, dialogid=88, response=1, listitem=95, inputtext[]=@0x0095aea0 "") at C:\sampserver\pawno\include\YSI\internal\y_dohooks .inc:3349

my ProxDetector:
PHP Code:
public ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid) && GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
    {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        
//radi = 2.0; //Trigger Radius
        
foreach(Playeri)
            if(
GetPlayerInterior(playerid) == GetPlayerInterior(i))
                if(!
BigEar[i])
                {
                    
GetPlayerPos(iposxposyposz);
                    
tempposx = (oldposx -posx);
                    
tempposy = (oldposy -posy);
                    
tempposz = (oldposz -posz);
                    if(((
tempposx floatdiv(radi,16)) && (tempposx > -floatdiv(radi,16))) && ((tempposy floatdiv(radi,16)) && (tempposy > -floatdiv(radi,16))) && ((tempposz floatdiv(radi,16)) && (tempposz > -floatdiv(radi,16))))
                    {
                        
SendClientMessage(icol1string); // <- this line makes the crash
                    
}
                    else if(((
tempposx floatdiv(radi,8)) && (tempposx > -floatdiv(radi,8))) && ((tempposy floatdiv(radi,8)) && (tempposy > -floatdiv(radi,8))) && ((tempposz floatdiv(radi,8)) && (tempposz > -floatdiv(radi,8))))
                    {
                        
SendClientMessage(icol2string);
                    }
                    else if(((
tempposx floatdiv(radi,4)) && (tempposx > -floatdiv(radi,4))) && ((tempposy floatdiv(radi,4)) && (tempposy > -floatdiv(radi,4))) && ((tempposz floatdiv(radi,4)) && (tempposz > -floatdiv(radi,4))))
                    {
                        
SendClientMessage(icol3string);
                    }
                    else if(((
tempposx floatdiv(radi,2)) && (tempposx > -floatdiv(radi,2))) && ((tempposy floatdiv(radi,2)) && (tempposy > -floatdiv(radi,2))) && ((tempposz floatdiv(radi,2)) && (tempposz > -floatdiv(radi,2))))
                    {
                        
SendClientMessage(icol4string);
                    }
                    else if(((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                    {
                        
SendClientMessage(icol5string);
                    }
                }
                else
                {
                    
SendClientMessage(icol1string);
                }
    }
    return 
1;

when and how it has been called:
PHP Code:
        format(thestringsizeof(thestring), "%s trocou a rбdio do veнculo para a %s"Player[playerid][pName], DOF2_GetString(arquivo,endereco));
        
ProxDetector(30.0playeridthestringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
anyone has any idea how to fix?
Is it really a bug from sa:mp ?
I'm using centOS, 64bits, dedicated server, samp 0.3e R2
thank you
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)