Help ! DCMD some bug(s)
#1

Hi guys

i have this CMD

pawn Код:
dcmd_dedit(playerid, params[])
{
    new idx, text[128], string[128];
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
    if(sscanf(params, "s[128]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit [option] [doorid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Pickup | Text | Interior | Exterior | CustomInterior | CustomExterior");
        return 1;
    }
    if(!strcmp(params, "pickup", true, 6))
    {
        new pickup;
        if(sscanf(params, "s[128]ii", params, idx, pickup)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit pickup [doorid] [pickupid]");
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        DoorInfo[idx][dType] = pickup;
        if(IsValidDynamicPickup(DoorInfo[idx][dPickup]))
        {
            DestroyDynamicPickup(DoorInfo[idx][dPickup]);
        }
        DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
        format(string, sizeof(string), " You have set door ID %d's pickup to %d", idx, pickup);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if(!strcmp(params, "text", true, 4))
    {
        if(sscanf(params, "s[128]is[128]", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit text [doorid] [text]");
        if(AntiAdv(playerid, params)) return 1;
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        format(DoorInfo[idx][dText], 128, "%s", text);
        format(string, sizeof(string), "ID: %d\n%s", idx, DoorInfo[idx][dText]);
        UpdateDynamic3DTextLabelText(DoorInfo[idx][dTextID], COLOR_WHITE, string);
        format(string, sizeof(string), " You have set door ID %d's text to %s", idx, text);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if(!strcmp(params, "interior", true, 8))
    {
        if(sscanf(params, "s[128]i", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit interior [doorid]");
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        DoorInfo[idx][dIInt] = GetPlayerInterior(playerid);
        DoorInfo[idx][dIVW] = GetPlayerVirtualWorld(playerid);
        GetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
        GetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
        format(string, sizeof(string), " You have set door ID %d's interior to your coordinates. (Int: %d | VW: %d)", idx, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if(!strcmp(params, "exterior", true, 8))
    {
        if(sscanf(params, "s[128]i", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit interior [doorid]");
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        DoorInfo[idx][dOInt] = GetPlayerInterior(playerid);
        DoorInfo[idx][dOVW] = GetPlayerVirtualWorld(playerid);
        GetPlayerFacingAngle(playerid, DoorInfo[idx][dOA]);
        GetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
        DestroyDynamicPickup(DoorInfo[idx][dPickup]);
        DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
        DestroyDynamic3DTextLabel(DoorInfo[idx][dTextID]);
        format(string, sizeof(string), "ID: %d\n%s", idx, DoorInfo[idx][dText]);
        DoorInfo[idx][dTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]+0.3, 15);
        format(string, sizeof(string), " You have set door ID %d's exterior to your coordinates. (Int: %d | VW: %d)", idx, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if(!strcmp(params, "custominterior", true, 14))
    {
        if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit custominterior [doorid]");
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        if(!DoorInfo[idx][dCInt])
        {
            DoorInfo[idx][dCInt] = 1;
            format(string, sizeof(string), " You have set door ID %d to have a custom interior.", idx, text);
        }
        else
        {
            DoorInfo[idx][dCInt] = 0;
            format(string, sizeof(string), " You have set door ID %d to have a normal interior.", idx, text);
        }
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if(!strcmp(params, "customexterior", true, 14))
    {
        if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit customexterior [doorid]");
        if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
        if(!DoorInfo[idx][dCExt])
        {
            DoorInfo[idx][dCExt] = 1;
            format(string, sizeof(string), " You have set door ID %d to have a custom exterior.", idx, text);
        }
        else
        {
            DoorInfo[idx][dCExt] = 0;
            format(string, sizeof(string), " You have set door ID %d to have a normal exterior.", idx, text);
        }
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    return 1;
}
but in game this




i use /dedit pickup or interior or exterior or ...

i get this message

Код:
[21:58:56] USAGE: /dedit [option] [doorid]

[21:58:56] OPTIONS: Pickup | Text | Interior | Exterior | CustomInterior | CustomExterior
Reply
#2

Make sure that you are typing the pickup id correctly. Pickup IDs:
Click me!
Reply
#3

Quote:
Originally Posted by bensmart469
Посмотреть сообщение
Make sure that you are typing the pickup id correctly. Pickup IDs:
Click me!
What do you mean ?!
Reply
#4

I meant, it has a "?" icon because you have most likely added an invalid pickup ID.
Reply
#5

Quote:
Originally Posted by bensmart469
Посмотреть сообщение
I meant, it has a "?" icon because you have most likely added an invalid pickup ID.
i can add any pickup ( + object )


but i think problem in DCMD :/ !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)