2 problems.
#1

Hi all.

I've some problems in scripting. Namely, with dcmd & unknow command.

1. Dcmd: so, if I adding this command:
Код:
dcmd_heal(playerid, params[])
{
        new id;
	if (!strlen(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
	id = strval(params);
	if (!IsPlayerConnected(id))SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	SetPlayerHealth(id, 100.0);
	SendClientMessage(id, 0x00FF00AA, "You have been healed");
	SendClientMessage(playerid, 0x00FF00AA, "Player healed");
	return 1;
}
i've got this error:
"undefined symbol dcmd_heal"

PS: I added
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
2: Unknow command: so, i tried to add this script:
Код:
 	return SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Info: {FFFFFF}Unavailable command! Use /help!");
}
after callback OnPlayerCommandReceived (accurate, under return), but when i use some commands (/sm, /pay), this message appears, although commands are included in callback OnPlayerCommandsReceived.

@ Sorry for my (very) bad english!
Reply
#2

I've seen something about dcmd_cmdname at OnPlayerCommandText...
By the way, why not try ZCMD easier and faster
Reply
#3

I know that zcmd is much easier and faster, but my filterscript is in DCMD and i want to put it in gamemode.

@ Do you know a converter?
Reply
#4

Quote:
Originally Posted by Addons
Посмотреть сообщение
I know that zcmd is much easier and faster, but my filterscript is in DCMD and i want to put it in gamemode.

@ Do you know a converter?
How about using "CTRL+H" and then converting every "dcmd_" to "CMD:" and removing the dcmd_ additional calls under 'OnPlayerCommandText'?
Reply
#5

So easy. I try to add this command (for testing):
Код:
CMD:buycar(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
		else return SendClientMessage(playerid, -1, "TEST");
	}
	return 1;
}
and i get this error:
symbol "buycar" is never used
Reply
#6

Add

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(heal, 4, cmdtext);
+ if you don't know this number "4"
EX : heal = 4
hheal = 5

Number of characters
Reply
#7

Quote:
Originally Posted by Addons
Посмотреть сообщение
So easy. I try to add this command (for testing):
Код:
CMD:buycar(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
		else return SendClientMessage(playerid, -1, "TEST");
	}
	return 1;
}
and i get this error:
symbol "buycar" is never used
Do you have add

#include <ZCMD> ?
Reply
#8

EDIT: I've added command at "OnPlayerCommandText" and i've got these errors:
Код:
G:\PROFEG RPG\PROFEG RPG\PROFEG RPG\gamemodes\gf.pwn(26071) : warning 217: loose indentation
G:\PROFEG RPG\PROFEG RPG\PROFEG RPG\gamemodes\gf.pwn(26071) : error 029: invalid expression, assumed zero
G:\PROFEG RPG\PROFEG RPG\PROFEG RPG\gamemodes\gf.pwn(26071) : error 017: undefined symbol "cmd_buycar"
G:\PROFEG RPG\PROFEG RPG\PROFEG RPG\gamemodes\gf.pwn(26071) : error 029: invalid expression, assumed zero
G:\PROFEG RPG\PROFEG RPG\PROFEG RPG\gamemodes\gf.pwn(26071) : fatal error 107: too many error messages on one line
26071: CMD:buycar(playerid, params[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)