CMD help
#1

I maked a division Cmd / locker cmd
but it seems to be not working

error : Server Command Unknow

code

PHP код:
CMD:DoCdiv(playeridparams[])
{
    if(
PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pRank] >= 5)
    {
        new 
string[128], giveplayeriddivision;
        if(
sscanf(params"ud"giveplayeriddivision))
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /DoCdiv [playerid] [division]");
            
SendClientMessageEx(playeridCOLOR_GRAD2"Available division names: 0 (None), 1 (HR), 2 (GU), 3 (PTR), 4 (SO)");
            return 
1;
        }
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pRank] >= 5)
            {
                if(
division == 0)
                {
                    if (
PlayerInfo[giveplayerid][pMember] == 3)
                    {
                        
PlayerInfo[giveplayerid][pDivision] = 0;
                        
format(stringsizeof(string), "You have been kicked from your division by %s."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "You have kicked %s out of their division."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
                else if(
division == 1)
                {
                    if (
PlayerInfo[giveplayerid][pMember] == 3)
                    {
                        
PlayerInfo[giveplayerid][pDivision] = 1;
                        
format(stringsizeof(string), "You are now in the Human Resources division, invited by %s."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "You have invited %s to join the Human Resources division."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
                else if(
division == 2)
                {
                    if (
PlayerInfo[giveplayerid][pMember] == 3)
                    {
                        
PlayerInfo[giveplayerid][pDivision] = 2;
                        
format(stringsizeof(string), "You are now in the Gang Unit, invited by %s."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "You have invited %s to join the Gang Unit division."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
                else if(
division == 3)
                {
                    if (
PlayerInfo[giveplayerid][pMember] == 3)
                    {
                        
PlayerInfo[giveplayerid][pDivision] = 3;
                        
format(stringsizeof(string), "You are now in the Prisoner Transport division, invited by %s."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "You have invited %s to join the Prisoner Transport division."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
                else if(
division == 4)
                {
                    if (
PlayerInfo[giveplayerid][pMember] == 3)
                    {
                        
PlayerInfo[giveplayerid][pDivision] = 4;
                        
format(stringsizeof(string), "You are now in the Special Operations division, invited by %s."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "You have invited %s to join the Special Operations division."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
            }
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command - only R5+ can do this.");
        }
    }
    return 
1;

Lockers

PHP код:
CMD:DoC(playeridparams[])
{
    if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 3)
     {
          if(
IsPlayerInRangeOfPoint(playerid4.0293.675415188.2382961007.171875+0.6))
        {
             
ShowPlayerDialog(playeridDIALOG_DoCDIALOG_STYLE_LIST"DoC: Lockers""Toggle Duty\nEquipment\nClothing Selection\nClear Suspect""Proceed""Cancel");
         }
          else
        {
              
SendClientMessageEx(playeridCOLOR_WHITE"You aren't in range of your DoC lockers.");
         }
      }
    return 
1;

Reply
#2

Try this:
pawn Код:
CMD:doc(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
        if(IsPlayerInRangeOfPoint(playerid, 4.0, 293.675415, 188.238296, 1007.171875+0.6))
        {
            ShowPlayerDialog(playerid, DIALOG_DoC, DIALOG_STYLE_LIST, "DoC: Lockers", "Toggle Duty\nEquipment\nClothing Selection\nClear Suspect", "Proceed", "Cancel");
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "You aren't in range of your DoC lockers.");
            return 1;
        }
    }
    return 1;
}
Reply
#3

You are should return 1 on the end }
Reply
#4

Hm gonna try it thanks !

( can you maybe fix the other also ? )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)