Team Mates System! Need Help...
#7

You shoudl use SetplayerTeamFromClass if you want specific skins to be of specific teams.

In your duty command I could not find a variable that tells us if an admin is currently on duty or not.
For that you may create enum or a global variable.
i will show you with enum (as you can easily edit it after)

Declaring enum
pawn Код:
enum PlayerInfo
{
   pDuty,
}

new pInfo[MAX_PLAYERS][PlayerInfo];
pawn Код:
CMD:onduty(playerid,parmas[])
    {
    if(IsPlayerLuxAdminLevel(playerid,2))
    {
    SetPlayerSkin(playerid,217);
    GivePlayerWeapon(playerid,38,500000);
    SetPlayerHealth(playerid,999999999);
    SetPlayerArmour(playerid,999999999);
    SetPlayerColor(playerid,COLOR_PINK);
    pInfo[playerid][pDuty] = 1; //Player is now on duty
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"ADM CMD: %s is Now On An Admin Duty",pName);
    SendClientMessageToAll(0xFF66FFAA,string);
    }
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
    return 1;
    }
   
CMD:offduty(playerid,parmas[])
    {
    if(IsPlayerLuxAdminLevel(playerid,2))
    {
    pInfo[playerid][pDuty] = 0;//Player is off duty
    ResetPlayerWeapons(playerid);
    ForceClassSelection(playerid);
    SetPlayerHealth(playerid,0);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"ADM CMD: %s is End With His Admin Duty",pName);
    SendClientMessageToAll(0xFF66FFAA,string);
    }
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
    return 1;
    }
Now, lets make your fly command.
pawn Код:
CMD:fly(playerid,parmas[])
    {
    if(IsPlayerLuxAdminLevel(playerid,2))
    {
    if (pInfo[playerid][pDuty] == 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: You must be on duty to use this cmd.");
    else StartFly(playerid);
    }
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
    return 1;
    }
CMD:stopfly(playerid,parmas[])
    {
    if(IsPlayerLuxAdminLevel(playerid,2))
    {
    StopFly(playerid);
    }
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
    return 1;
    }
Reply


Messages In This Thread
Team Mates System! Need Help... - by iOmar - 18.06.2012, 13:00
Re: Team Mates System! Need Help... - by [MM]RoXoR[FS] - 18.06.2012, 13:07
Re: Team Mates System! Need Help... - by iOmar - 18.06.2012, 13:53
Re: Team Mates System! Need Help... - by Faisal_khan - 18.06.2012, 14:03
Re: Team Mates System! Need Help... - by Avi57 - 18.06.2012, 14:07
Re: Team Mates System! Need Help... - by iOmar - 18.06.2012, 14:07
Re: Team Mates System! Need Help... - by [MM]RoXoR[FS] - 18.06.2012, 14:47
Re: Team Mates System! Need Help... - by iOmar - 18.06.2012, 17:20
Re: Team Mates System! Need Help... - by Faisal_khan - 19.06.2012, 01:15
Re: Team Mates System! Need Help... - by iOmar - 19.06.2012, 03:24

Forum Jump:


Users browsing this thread: 4 Guest(s)