10.10.2011, 06:59
Oh..forgot to paste it -_-
Code:
Code:
pawn Код:
CMD:setleader( playerid, params[ ] )
{
if ( GetPVarInt( playerid, "Level" ) < 3 && !IsPlayerAdmin( playerid ) )
return SendClientMessage( playerid, -1, "You are not allowed to use this command");
if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setleader [PlayerID] [TeamID 1 - 3] Teams: ID 1: Airwolves. ID 2: Bluefoxes. ID 3: Thunderbirds"),SendClientMessage( playerid, -1, "-Check "COL_LIGHTBLUE"/levelranks{FFFFFF} to view each level's name");
if ( !IsPlayerConnected( params[ 0 ] ) )
return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
if ( params[ 1 ] < 0 || params[ 1 ] > 3 )
return SendClientMessage( playerid, -1, "You must insert from ID "COL_LIGHTBLUE"0{FFFFFF} to "COL_LIGHTBLUE"3{FFFFFF}");
if ( GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
SetPVarInt( params[ 0 ], "Leader", params[ 1 ] );
new String[ 256 ];
new id;
if ( GetPVarInt( playerid, "Leader" ) == 0 )
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,35,60); //Rocket Launcher
GivePlayerWeapon(playerid,30,200); //AK-47
SetPlayerColor(playerid,COLOR_RED);
SetPlayerPos(playerid, 414.6559,2531.7651,19.1601);
SetPlayerTeam(playerid, 0);
SetPVarInt( params[ 0 ], "Leader", 0 );
format( String, sizeof String, "You made yourself leader of nothing!", params[ 1 ], GetPlayerLevelName( playerid ) );
SendClientMessage( playerid, -1, String );
}
else if ( GetPVarInt( playerid, "Leader" ) == 1 )
{
SetPlayerColor(playerid,COLOR_GREY);
SetPlayerSkin(playerid, 61);
SetPlayerTeam(playerid, 1);
SetPVarInt( params[ 0 ], "Leader", 1 );
SetPlayerPos(playerid, 1607.7803,1169.4840,14.2188);
GivePlayerWeapon(playerid,35,60); //Rocket Launcher
GivePlayerWeapon(playerid,26,100); //Sawn-off Shotgun
GivePlayerWeapon(playerid,30,200); //AK-47
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
format( String, sizeof String, "You made yourself leader of Airwolves!", params[ 1 ], GetPlayerLevelName( playerid ) );
SendClientMessage( playerid, -1, String );
}
else if ( GetPVarInt( playerid, "Leader" ) == 2 )
{
SetPlayerColor(playerid,COLOR_DBLUE);
SetPlayerTeam(playerid, 2);
SetPlayerSkin(playerid, 61);
SetPVarInt( params[ 0 ], "Leader", 2 );
SetPlayerPos(playerid, 1998.3118,-2352.3438,13.5469);
GivePlayerWeapon(playerid,35,60); //Rocket Launcher
GivePlayerWeapon(playerid,26,100); //Sawn-off Shotgun
GivePlayerWeapon(playerid,30,200); //AK-47
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
format( String, sizeof String, "You made yourself leader of Bluefoxes!", params[ 1 ], GetPlayerLevelName( playerid ) );
SendClientMessage( playerid, -1, String );
}
else if ( GetPVarInt( playerid, "Leader" ) == 3 )
{
SetPlayerColor(playerid,COLOR_YELLOW);
SetPlayerTeam(playerid, 3);
SetPlayerSkin(playerid, 61);
SetPVarInt( params[ 0 ], "Leader", 3 );
SetPlayerPos(playerid, -687.5341,425.3484,11.5729);
GivePlayerWeapon(playerid,35,60); //Rocket Launcher
GivePlayerWeapon(playerid,26,100); //Sawn-off Shotgun
GivePlayerWeapon(playerid,30,200); //AK-47
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
format( String, sizeof String, "You made yourself leader of Thunderbirds!", params[ 1 ], GetPlayerLevelName( playerid ) );
SendClientMessage( playerid, -1, String );
}
return 1;
}