11.05.2009, 21:00
I added in my pawno code:
1)
2) In OnPlayerCommandText
3) under OnPlayerCommandText
And got these errors:
\GM.pwn(405) : error 017: undefined symbol "sscanf"
405 line is: if (sscanf(params, "u", id))........
What I did is not right?
--------------------------------------
I also wanted to ask,My mode half of commands made through:
if(!strcmp(cmdtext, "/cmd, true))
and the other half through dcmd:
dcmd(CMD, 3, cmdtext);
This is bad, or nothing scary?
1)
pawn Код:
#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
pawn Код:
dcmd(heal, 4, cmdtext);
pawn Код:
dcmd_heal(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed");
SendClientMessage(playerid, 0x00FF00AA, "Player healed");
}
return 1;
}
\GM.pwn(405) : error 017: undefined symbol "sscanf"
405 line is: if (sscanf(params, "u", id))........
What I did is not right?
--------------------------------------
I also wanted to ask,My mode half of commands made through:
if(!strcmp(cmdtext, "/cmd, true))
and the other half through dcmd:
dcmd(CMD, 3, cmdtext);
This is bad, or nothing scary?