SA-MP Forums Archive
Y_CMD Issue - 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: Y_CMD Issue (/showthread.php?tid=469823)



Y_CMD Issue - UnknownGamer - 14.10.2013

pawn Код:
YCMD:pickup(playerid, params[], help)
{
    if(help) return SCM(playerid, COLOR_GREY, "Not supported");

    return ycmd_p(playerid, params, help);
}
Errm, how do you do that? I attempted to re-do that from ZCMD. That doesn't work ^


Re: Y_CMD Issue - Patrick - 14.10.2013

Here you go
pawn Код:
Command_AddAltNamed("pickup", "p");//underneath the callback OnGameModeInit



Re: Y_CMD Issue - DanishHaq - 14.10.2013

pawn Код:
public OnGameModeInit()
{
    Command_AddAltNamed("pickup", "p"); // this will add "/p" as an alternate name for "/pickup"
    return 1;
}
https://sampforum.blast.hk/showthread.php?tid=169029

Meh, he was faster .


Re: Y_CMD Issue - UnknownGamer - 14.10.2013

Cheers.

+REP to both of you.

Errm, that didn't work.

pawn Код:
public OnGameModeInit()
{
    dbhandle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS);
    mysql_log(LOG_ERROR | LOG_WARNING);
    new er = mysql_errno(dbhandle);
    if(!er) {
        printf("[Script] DBHandle acquired %d", dbhandle);
    } else {
        printf("*****\n\n\n\nSomething went wrong with your database connection! Check the mysql_log.txt (er: %d)\n\n\n\n\n*******", er);
        GameModeExit();
    }

    Command_AddAltNamed("sal", "setadminlevel");



Re: Y_CMD Issue - Ada32 - 14.10.2013

Код:
Command_AddAltNamed("setadminlevel", "sal");



Re: Y_CMD Issue - DanishHaq - 14.10.2013

On my example, /pickup is the original command with all the code, and /p is the shortened version which is the alternate name.


Re: Y_CMD Issue - UnknownGamer - 15.10.2013

Quote:
Originally Posted by Ada32
Посмотреть сообщение
Код:
Command_AddAltNamed("setadminlevel", "sal");
ya, I got it the wrong way round +REP!

Thankyou!!