Errors on commands
#1

The error is:
Код:
C:\Users\mattt\Desktop\New\gamemodes\arrp.pwn(348) : error 017: undefined symbol "dcmd_ahelp"
C:\Users\mattt\Desktop\New\gamemodes\arrp.pwn(349) : error 017: undefined symbol "dcmd_sethp"
C:\Users\mattt\Desktop\New\gamemodes\arrp.pwn(383) : error 017: undefined symbol "dcmd_ahelp"
C:\Users\mattt\Desktop\New\gamemodes\arrp.pwn(390) : error 017: undefined symbol "dcmd_sethp"
on these lines:
Код:
dcmd(stats, 5, cmdtext);
dcmd(ahelp, 5, cmdtext);
dcmd(sethp, 5, cmdtext);

dcmd_ahelp(playerid, params[])
{
SendClientMessage(playerid, COLOUR_YELLOW, "TEST: /SETHP || /GETCAR || /COMEHERE || /GOTO");
SendClientMessage(playerid, COLOUR_YELLOW, "TEST: /SETSKIN || /GIVECASH || /GIVEWEAPON || /FREEZE");
SendClientMessage(playerid, COLOUR_YELLOW, "TEST: /UNFREEZE || /CHANGENAME || /KICK || /BAN");
}

dcmd_sethp(playerid, params[])
{
SetPlayerHealth(playerid, 100);
}
But it doenst pick up an error on this one which i have used:
Код:
	
dcmd(stats, 5, cmdtext);
if that makes sence thanks for the help
Reply
#2

OK, here are a few errors in your code.

1. You should return a value on your DCMD commands.
2. You can just use strcmp if you don't need params
3. The errors are because you are not putting the dcmd things in the right place.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(stats, 5, cmdtext);
    dcmd(ahelp, 5, cmdtext);
    dcmd(sethp, 5, cmdtext);
    return 0;
}
Also make sure that you have the define line for DCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)