dcmd command not working, puts out "SERVER: Unknown Command"
#1

pawn Code:
dcmd_setdrugs(playerid,params[]) {
    new str[128];
    if(IsPlayerAdmin(playerid)) {
        new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
        if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /givedrugs [playerid] [amount]");
        new player1 = strval(tmp), amount = strval(tmp2);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
            format(str,sizeof(str),"You have given %s %d amount of drugs", player1, amount);
            SendClientMessage(playerid,green,str);
            if(player1 != playerid) {
                format(str,sizeof(str),"Admin %s has Set your Drugs to '%d'", playerid, amount);
                SendClientMessage(player1,green,str);
            }
            ResetPlayerDrugs(player1);
            GivePlayerDrugs(player1, amount);
        } else SendClientMessage(playerid,red,"ERROR: Player is not connected");
    } else SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    return 1;
}

//commandtext
dcmd(setdrugs,8,cmdtext);
help please?
Reply
#2

have u defined dcmd on the top?
this:
Code:
 #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
i think so... i dno sorry.
Reply
#3

Didn't work, just found out that none of commands in the script work D:
Reply
#4

:O, all using dcmd? well make sure u defined it and i thought i kinda had this problem.. i had a command called /rb that succesfully worked but all commands under it: /rrb /rrball didnt work it was a bracket( } ) then
absolutely none 0% of all those commands work? or does one do?
upload ur script please.
Reply
#5

nevar here, check your pms in like 30 seconds
Reply
#6

Bumpy Bumpy
Reply
#7

Quote:
Originally Posted by willsuckformoney
View Post
Bumpy Bumpy
dcmd seems fine...
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


can you show us up your OnPlayerCommandText() ?
i couldn't find any incorrect native functions used or logical errors but you need to recheck it
and are you using another filterscripts? or gamemode?
Reply
#8

Is it on your Game Mode or Filterscripts? prolly a "return 1" bug, You should always return 0 in the end of "OnPlayerCommandText"
Reply
#9

If you use zcmd then on player command text is not called
Reply
#10

So was it the returns?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)