[Help] /setbl
#8

This?
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define BLFACTION 1
new gTeam[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    gTeam[playerid] = 0;
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == 0)
    {
        if(!IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid, 0xFF0000FF, "You Have Not Been Authorised To Spawn.");
            return 0;
        }
    }
    return 1;
}

CMD:setbl(playerid,params[])
{
    new id;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be Logged Into RCON To Use This Command.");
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX ERROR: {00FF00}/SETBL {FFFF00}<PlayerID>");
    if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Not Connected.");
    if(gTeam[id] != BLFACTION) return SendClientMessage(playerid, 0xFF0000FF, "This Player Has Already Been Authorised.");
    new string[70];
    new AdminName[MAX_PLAYER_NAME], PlayersName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, AdminName, MAX_PLAYER_NAME);
    GetPlayerName(id, PlayersName, MAX_PLAYER_NAME);
    format(string,sizeof(string),"Administrator %s Has Authorised You To Spawn.",AdminName);
    SendClientMessage(id, 0xFFFF00FF, string);
    format(string,sizeof(string),"You Have Authorised %s To Spawn.",PlayersName);
    SendClientMessage(playerid, 0xFFFF00FF, string);
    gTeam[id] = BLFACTION;
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    gTeam[playerid] = 0;
    return 1;
}
Reply


Messages In This Thread
[Help] /setbl - by Deaglez - 11.09.2012, 04:26
Re: [Help] /setbl - by Deaglez - 11.09.2012, 07:00
Re: [Help] /setbl - by Roach_ - 11.09.2012, 09:19
Re: [Help] /setbl - by clarencecuzz - 11.09.2012, 09:27
Re: [Help] /setbl - by Roach_ - 11.09.2012, 09:32
Re: [Help] /setbl - by clarencecuzz - 11.09.2012, 09:33
Re: [Help] /setbl - by Deaglez - 11.09.2012, 09:45
Re: [Help] /setbl - by clarencecuzz - 11.09.2012, 09:56
Re: [Help] /setbl - by Deaglez - 11.09.2012, 13:03
Re: [Help] /setbl - by Deaglez - 11.09.2012, 13:06

Forum Jump:


Users browsing this thread: 1 Guest(s)