SA-MP Forums Archive
Trouble with ZCMD: - 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: Trouble with ZCMD: (/showthread.php?tid=400518)



Trouble with ZCMD: - UnknownGamer - 19.12.2012

pawn Код:
public OnPlayerCommandReceived(playerid, params[])
{
    #pragma tabsize 0
    dcmd(spec, 4, cmdtext);
    dcmd(specoff, 7, cmdtext);
    dcmd(saveeverything, 4, cmdtext);
    dcmd(xgoto, 5, cmdtext);
    dcmd(gpsfind, 7, cmdtext);
    dcmd(attach,6,cmdtext);
    dcmd(unattach,8,cmdtext);
    dcmd(acheckcode,10,cmdtext);
    dcmd(alias,5,cmdtext);
    dcmd(ips,3,cmdtext);
    dcmd(getips,6,cmdtext);
    dcmd(getaliases,10,cmdtext);
    dcmd(unban,5,cmdtext);
    //dcmd(saveeverything,14,cmdtext);
    new string[512 char];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[128];
    new tmp[128];
    new dancestyle;
    new giveplayerid, moneys, idx;
    new idcar = GetPlayerVehicleID(playerid);
    new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
    cmd = strtok(cmdtext, idx);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new y5, m5, d5;
    new h5,mi5,s5;
    getdate(y5,m5,d5);
    gettime(h5,mi5,s5);
    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> %s",d5,m5,y5,h5,mi5,s5,sendername,cmdtext);
    AllCommandLog(string);
Can anyone explain what is causing Pawno to crash, or CMD_ errors? I have the #include at the top...


Re: Trouble with ZCMD: - PlayLSX_Founder - 19.12.2012

Why have you got dcmd commands under a zcmd callback?..


Re: Trouble with ZCMD: - [Ro]DuReX - 19.12.2012

Put that code under "OnPlayerCommandText" callback.
If you aren't using ZCMD commands, remove that callback (OnPlayerCommandReceived)