05.04.2011, 02:31
The teams are made like this etc
And members like this (same way)
pawn Код:
COMMAND:setleader(playerid, params[])
{
new id,oleader;
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, 0xFF0000FF, "Only RCON admins can use this command!!");
if(sscanf(params,"ui", id,oleader))return SendClientMessage(playerid, 0x33CCFFAA, "Usage: /setleader [PlayerID] [TeamID 1 - 3] Teams: ID 1: Airwolves. ID 2: Bluefoxes. ID 3: Thunderbirds");
if(oleader > 9)return SendClientMessage(playerid,red,"Please type /orgids");
if(oleader == 1)//Set Leader to Airwolves.
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has set you the leader of Airwolves.",Name);
SendClientMessage(id,green, String);
SetPlayerColor(id,COLOR_GREY);
SetPlayerTeam(id, 1);
SetPlayerSkin(id, 61);
SetPlayerPos(id, 1607.7803,1169.4840,14.2188);
GivePlayerWeapon(id,36, 75); //HS Rocket Launcher **
GivePlayerWeapon(id,27, 100); //Combat Shotgun
GivePlayerWeapon(id, 38, 100); //Minigun
GivePlayerWeapon(id, 30, 350); //AK-47
Leader[id] = 1;
Member[id] = 1;
IsInOrg[id] = 1;
OrgId[id] = 1;
IsLaw[id] = 0;
IsPriv[id] = 1;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have set a new leader for Airwolves.",Name);
SendClientMessage(playerid,green, String);
}
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, 414.6559,2531.7651,19.1601);
GivePlayerWeapon(playerid,36,60); //HS Rocket Launcher **
GivePlayerWeapon(playerid,30,200); //AK-47
SetPlayerTeam(playerid, 0);
SetPlayerColor(playerid, COLOR_RED);
FSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid);//This creates a timer when the player spawns and it saves the file ever 1 second.
if(Member[playerid] == 1)
{
SetPlayerColor(playerid,COLOR_GREY);
SetPlayerTeam(playerid, 1);
SetPlayerSkin(playerid, 255);
SetPlayerPos(playerid, 1607.7803,1169.4840,14.2188);
GivePlayerWeapon(playerid,36,60); //HS Rocket Launcher **
GivePlayerWeapon(playerid,27,100); //Combat Shotgun
GivePlayerWeapon(playerid,30,200); //AK-47
SendClientMessage(playerid,COLOR_GREY,"Combat Team: Airwolves.");
}