weird bug / crash by native SendClientMessage
#4

Quote:
Originally Posted by Vince
View Post
Yet another godfather edit, why am I not surprised? If the code size message comes up when compiling your GM then that may be the cause.
You should know, doesn't matter if it is a godfather edit or anything else, the samp native should work the same way
Btw I didn't understand what u meant




Quote:
Originally Posted by Makaveli93
View Post
Try

pawn Code:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid) && GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        new result[128];format(result, 128, "%s", string);
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        foreach(Player, i)
            if(GetPlayerInterior(playerid) == GetPlayerInterior(i))
                if(!BigEar[i])
                {
                    GetPlayerPos(i, posx, posy, posz);
                    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(i, col1, result); // <- 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(i, col2, result);
                    }
                    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(i, col3, result);
                    }
                    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(i, col4, result);
                    }
                    else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, result);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, result);
                }
    }
    return 1;
}
Hum, shouldn't better 144 instead of 128 ?

but do you really think a long string could crash a server?
Reply


Messages In This Thread
weird bug / crash by native SendClientMessage - by dudaefj - 11.08.2012, 07:35
Re: weird bug / crash by native SendClientMessage - by Vince - 11.08.2012, 11:06
Re: weird bug / crash by native SendClientMessage - by Makaveli93 - 11.08.2012, 11:09
Respuesta: Re: weird bug / crash by native SendClientMessage - by dudaefj - 11.08.2012, 12:33
Re: Respuesta: Re: weird bug / crash by native SendClientMessage - by Vince - 11.08.2012, 16:48
Respuesta: Re: Respuesta: Re: weird bug / crash by native SendClientMessage - by dudaefj - 12.08.2012, 09:05

Forum Jump:


Users browsing this thread: 1 Guest(s)