SA-MP Forums Archive
dcmd help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: dcmd help (/showthread.php?tid=569561)



dcmd help - DetoNater - 31.03.2015

Will dcmd work in 0.3z server, actually i had dcmd in my old script is compiled with 0.3z, I think updating it to zcmd is better right??

but when I join server and type a command, it says Server:Unknown command, whether i have missed a line or not?



Re: dcmd help - Ritzy2K - 31.03.2015

can u explain a bit more please, or show your code? and yes zcmd woeks with 0.3z faster and easier than zcmd and make it more readable kinda.. whats the problem which command isnt working and what have you changed?


Re: dcmd help - CalvinC - 31.03.2015

Zcmd is both easier to use and is more effcient/faster than dcmd, you should definitely upgrade.


Re: dcmd help - DetoNater - 31.03.2015

I defined it.

pawn Код:
// Definitions
#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
and
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new commandshow[128];
    format(commandshow, sizeof(commandshow), "%s has used the command %s", PlayerName(playerid), cmdtext);
    printf(commandshow);
    if(!strcmp(cmdtext,"/")) return 1; //fix for Run time error 5: "Invalid memory access"
    if(!strcmp(cmdtext,"/tournament"))
    {
        new name[24];
        GetPlayerName(playerid,name,24);
        if(!strcmp(name,"[NoM]Vendetta[BF]") || !strcmp(name,"[BF]Harry[NoM]"))
        {
            SetPlayerPos(playerid,1556.0198, 33.5701, 23.1368);
        }
        return 1;
    }
    dcmd(bounties,8,cmdtext);
    dcmd(duels,5,cmdtext);
    dcmd(duel,4,cmdtext);
    dcmd(duelaccept,10,cmdtext);
    dcmd(duelreject,10,cmdtext);
    dcmd(time,4,cmdtext);
.......................etc etc



Re: dcmd help - Ritzy2K - 31.03.2015

I still dont really get what do you need assistance with.? do u want to turn those command into zcmd? or u want thoee command to stay in dcmd but they dont work? or u updated them into zcmd and they dont work? /:


Re: dcmd help - DetoNater - 31.03.2015

Quote:
Originally Posted by DopeX
Посмотреть сообщение
I still dont really get what do you need assistance with.? do u want to turn those command into zcmd? or u want thoee command to stay in dcmd but they dont work? or u updated them into zcmd and they dont work? /:
i ant assistance to get this dcmd working.... if its working fine i'll leave, else i'll have to convert all the commands to zcmd


Re: dcmd help - Ritzy2K - 31.03.2015

wheres the actual command?
like
dcmd_(ur command)
that code? u just showed half code kinda. and do they work?