Convert from dcmd to strcmp [Help me]
#1

Hello could some1 help me convert this script for me cuz aint working;S i think the problem is "dcmd"


here is the script

Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Код:
dcmd(wantedlvl, 9, cmdtext);
Код:
dcmd_wantedlvl(playerid, params[])
{
    if(gTeam[playerid] == TEAM_BLUE)
    {
        new targetid, wanted, reason;

        if(sscanf(params, "udz", targetid, wanted, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setwanted (id) (wanted-level) (reason)");
        else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID");
        else if(wanted < 7)
        {
            new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[256];
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerName(targetid, targetname, sizeof(targetname));

            SetPlayerWantedLevel(targetid, wanted);
            
            format(string, sizeof(string), "%s(%d) has set your wanted to %d because %s", playername, playerid, wanted, reason);
            SendClientMessage(targetid, COLOR_LIGHTGREEN, string);
            
            format(string, sizeof(string), "You has set %s(%d) wanted to %d because %s", targetname, targetid, wanted, reason);
            SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
            return 1;
        }
        else SendClientMessage(playerid, COLOR_RED,"USAGE: Minimum 0 || Maximum 6");
        return 1;
    }
    return 0;
}
if any1 understand these terms please help me !
Reply
#2

You really don't want to do it. Use dcmd and sscanf, it's like x20 easier.
Reply
#3

ye but i got sscanf and this script dosnt work for me i dno why
Reply
#4

Why would you want to change dcmd to strcmp that is the dumbest idea I've ever heard...
Reply
#5

okey i dno iam learning i dont now a shit about scripting atm Readed some guides etc but aint readed bout this anything wrong with my script why dosnt it work ?
Reply
#6

His whole gamemode is based on "strcmp"
And when he added the "dcmd" command then the command didnt work...

I dont know the problem but..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)