[HELP] DCMD not showing in-game
#1

Well, I write my code, follow the wiki.sa-mp.com tutorials, and compile with no issues.

When I get in-game, and type a command, nothing shows up.

I've been toying with it for about an hour with no avail.

Here is my code:

http://pastebin.com/m39644dd0

Any suggestions would be awesome.

Thanks, all.
Reply
#2

hello there, i am not sure what, "if (strlen(params))", is supposed to do, but im not that familar with this style command.

params[] = "is the string entered after the command" (https://sampwiki.blast.hk/wiki/Fast_Commands)

so you only need this if you have a command that either use id like, "/heal 4", or whatever.

pawn Код:
dcmd_kill(playerid, params[])
{
    #pragma unused params
    if (IsPlayerConnected(playerid))
    {
        SetPlayerHealth(playerid, 0.0);
        SendClientMessage(playerid, 0x008040FF, "You have killed yourself.");
    }
    return 1;
}
pawn Код:
dcmd_help(playerid, params[])
{
    #pragma unused params
    if (IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, 0x008040FF,"ACCOUNT: /rules,");
        SendClientMessage(playerid, 0x008040FF,"JOBS: /merchelp, /lawyerhelp, /armshelp, /drughelp, /wheelhelp");
        SendClientMessage(playerid, 0x008040FF,"HOUSES:");
        SendClientMessage(playerid, 0x008040FF,"CHAT: (/w)hisper, (/o)oc, (/s)hout, (/c)lose, (/l)ocal, (/b), (/ad)vertise, (/f)amily");
        SendClientMessage(playerid, 0x008040FF,"CHAT: /me, /togooc, /tognews, /togfam, /togwhisper");
        SendClientMessage(playerid, 0x008040FF,"BANK: /balance, /withdraw, /deposit, /transfer");
    }
    return 1;
}
pawn Код:
dcmd_rules(playerid, params[])
{
    #pragma unused params
    if (IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, 0x008040FF,"*** OUR RULES ***");
        SendClientMessage(playerid, 0x008040FF,"1) Always roleplay. Use /b to talk out of character.");
        SendClientMessage(playerid, 0x008040FF,"2) Never DM (Deathmatch - Killing without a roleplay reason).");
        SendClientMessage(playerid, 0x008040FF,"3) Show others respect, especially admins.");
        SendClientMessage(playerid, 0x008040FF,"4) Absolutely DO NOT Hack/Cheat/Glitch/Exploit. You WILL be banned.");
        SendClientMessage(playerid, 0x008040FF,"5) Any other questions/concerns - visit (to come)");
    }
    return 1;
}
Reply
#3

http://pastebin.com/f4f24ded2
Reply
#4

Fixed. Thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)