weird bug / crash by native SendClientMessage
#5

Quote:
Originally Posted by leonardo1434
View Post
use this one, i've made it now. it should works in the same way.

pawn Code:
stock newprox(playerid,Float:range,text[],co1,co2,co3,co4,co5)
{
    new Float:l_2[3];
    GetPlayerPos(playerid,l_2[0],l_2[1],l_2[2]);
    for(new i = 0; i != MAX_PLAYERS;++i) {
        if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))) {
            if(IsPlayerInRangeOfPoint(i,range/16,l_2[0],l_2[1],l_2[2])) SendClientMessage(i, co1, text);
            else if(IsPlayerInRangeOfPoint(i,range/8,l_2[0],l_2[1],l_2[2])) SendClientMessage(i, co2, text);
            else if(IsPlayerInRangeOfPoint(i,range/4,l_2[0],l_2[1],l_2[2])) SendClientMessage(i, co3, text);
            else if(IsPlayerInRangeOfPoint(i,range/2,l_2[0],l_2[1],l_2[2])) SendClientMessage(i, co4, text);
            else if(IsPlayerInRangeOfPoint(i,range,l_2[0],l_2[1],l_2[2])) SendClientMessage(i, co5, text);
        }
    }
    return 1;
}

//usage
newprox(playerid,30.0,#cool,-1,-1,-1,-1,-1);
and why should it help me to fix the crash by "SendClientMessage" ?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)