Y_CMD Issue
#1

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 ^
Reply
#2

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

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 .
Reply
#4

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");
Reply
#5

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

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

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

Thankyou!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)