/onduty is ok But /offduty?? (rep++)
#1

pawn Код:
if(strcmp(cmd, "/onduty", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {
        SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname);  SendClientMessage(i,pink,string);   }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;   }
===> I made this command by my self!!! But i can not make /offduty command. Can Any one Help in making me /offduty commands??
Reply
#2

Create a variable set it to 1 once they type onduty and set it to 0 once they go off duty.
Reply
#3

Do A better on duty like mine :P

Код:
    {
        if(SInfo[playerid][pAdmin] >= 4)
        {
        SetPlayerHealth(playerid, 100000.0);
        SetPlayerSkin(playerid, 294);
        SetPlayerColor(playerid, 0x00FFFFFF);
        GivePlayerWeapon(playerid, 38, 999999);
        GivePlayerWeapon(playerid, 16, 999999);
        SendClientMessage(playerid, ADMIN, "Admin Duty ON");
        }
		else return SendClientMessage(playerid, ROJO, "[Command not found on GTACNR , use /cmds or /commands to see it ]");
        return 1;
    }
Reply
#4

I don't get it! Please Please can you make it for me?? Copy it from mine /onduty cmd
Reply
#5

Use ZCMD is faster and easier

Код:
   
command(onduty, playerid, params[])
 {
        if(SInfo[playerid][pAdmin] >= 4)
        {
        SetPlayerHealth(playerid, 100000.0);
        SetPlayerSkin(playerid, 294);
        SetPlayerColor(playerid, 0x00FFFFFF);
        GivePlayerWeapon(playerid, 38, 999999);
        GivePlayerWeapon(playerid, 16, 999999);
        SendClientMessage(playerid, ADMIN, "Admin Duty ON");
        }
		else return SendClientMessage(playerid, ROJO, "[Command not found on GTACNR , use /cmds or /commands to see it ]");
        return 1;
    }
Reply
#6

No man! I don't want it But thnkx for giving it I want mine.. Please
Reply
#7

Код:
if(strcmp(cmd, "/offduty", true) == 0)	 
{
    if(PlayerInfo[playerid][Level] >= 2) 
{
    	CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
	   	for(new i = 0; i <= MAX_PLAYERS; i++)
		{
		if(IsPlayerConnected(i) == 1)	{

ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
SendClientMessage(i,pink,string);	}
		}
	} else 	{
	SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");	}
 	return 1;	}
Done
Reply
#8

ignoring zcmd? you will understand in the future. strcmp is slow. never mind you ignore it. but in the future you will come and use zcmd by the way

pawn Код:
new AdminDuty[MAX_PLAYERS]; //at the top of script after #include

if(strcmp(cmdtext, "/offduty", true) == 0)
{
    if(PlayerInfo[playerid][Level] >= 2)
    {
        if(AdminDuty[playerid] == 1)
        {
            CMDMessageToAdmins(playerid,"Now Off Duty");
            GetPlayerName(playerid, adminname, sizeof(adminname));
            AdminDuty[playerid] = 0;
        }
    }
    return 1;
}
Reply
#9

pawn Код:
new bool:IsInDuty[MAX_PLAYERS];///global variable
if(strcmp(cmd, "/onduty", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {
        IsOnDuty[playerid]=true;
        SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname);  SendClientMessage(i,pink,string);   }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;   }

if(strcmp(cmd, "/offduty", true) == 0)    {
{
     if(IsInDuty[playerid]==true)
      {
            IsInDuty[playerid]=false;
      }else{ SendClientMessage(playerid,0xFFFFFF,"You are not in duty to off");}
      return 1;
}
omg late post
Reply
#10

Thnx... It helped soo Much
==1 request!! In my GM when some one die it don't show icon on death window??
rep added
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)