11.09.2012, 09:56
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;
}