This cmd spamming chat
#2

SendClientMessage is inside the loop, therefore it spams. Put the SendClientMessage outside of the loop.

if you do it e.g like this, it wont spam:

pawn Код:
CMD:lock(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
   
    if(LockVeh[playerid] == false)
    {
        GameTextForPlayer(playerid, "~r~Vehicle Locked. Use again /lock to unlock it.", 5000, 5);
        SendClientMessage(playerid,yellow,"Vehicle locked.Use again /lock to unlock it.");
        LockVeh[playerid] = true;
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
            }
        }
    }
    else
    {
        GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /loc to lock it.", 5000, 5);
        SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it.");
        LockVeh[playerid] = false;
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
            }
        }

    }
    return 1;
}
Reply


Messages In This Thread
This cmd spamming chat - by Face9000 - 21.04.2012, 11:11
Re: This cmd spamming chat - by Richie© - 21.04.2012, 11:22
Re: This cmd spamming chat - by Face9000 - 21.04.2012, 11:28

Forum Jump:


Users browsing this thread: 1 Guest(s)