Problem with Spamming
#5

nah, you need to completely rewrite that..

pawn Код:
stock SendClientActionToRange(radi,playerid,string[])
{
    new Float:posx, Float:posy, Float:posz;
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);

    for (new i = 0; i <= SLOTS; i++)
        if (IsPlayerConnected(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
        {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx - posx);
                tempposy = (oldposy - posy);
                tempposz = (oldposz - posz);

                if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                     SendClientMessage(i, COLOR_PLAYERACTION, string);
        }
    return 1;
}
pawn Код:
if(strcmp(cmd, "/command", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if (!strlen(tmp))
        return SendClientMessage(playerid, COLOR_GREY, "USAGE: /service [police/fbi/rescue/taxi]");

    if (strcmp(tmp, "police", true) == 0)
    {
        new Float:p[3], playername[32], string[64];

        GetPlayerPos(playerid,p[0],p[1],p[2]);
        GetPlayerName(playerid, playername, 32);

        format(string, sizeof(string), "%s takes out his phone and dials 911", playername);
        SendClientActionToRange(15, playerid, string)

        for(new i=0;i<MAX_PLAYERS;i++)
        {
            DisablePlayerCheckpoint(i);
            SetPlayerCheckpoint(i,p[0],p[1],p[2],3.0);
        }
        return 1;
    }

    SendClientMessage(playerid, COLOR_GREY, "USAGE: /service [police/fbi/rescue/taxi]");
    return 1;
}
Reply


Messages In This Thread
Problem with Spamming - by tomnidi - 05.03.2009, 10:37
Re: Problem with Spamming - by [RP]Rav - 05.03.2009, 10:44
Re: Problem with Spamming - by tomnidi - 05.03.2009, 10:54
Re: Problem with Spamming - by Finn - 05.03.2009, 11:02
Re: Problem with Spamming - by [RP]Rav - 05.03.2009, 11:14
Re: Problem with Spamming - by Finn - 05.03.2009, 12:33
Re: Problem with Spamming - by [RP]Rav - 05.03.2009, 12:39
Re: Problem with Spamming - by tomnidi - 05.03.2009, 13:09
Re: Problem with Spamming - by [RP]Rav - 05.03.2009, 13:17
Re: Problem with Spamming - by tomnidi - 05.03.2009, 13:58

Forum Jump:


Users browsing this thread: 2 Guest(s)