Unknown command ?? :S -
prefex - 15.07.2012
pawn Code:
#include <a_samp>
#include <sscanf2>
#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
public OnPlayerCommandText(playerid, cmdtext[])
{
* * dcmd(givecash,8,cmdtext);
* * return 0;
}
dcmd_givecash(playerid, params[])
{
* * new
* * * * giveplayerid,
* * * * amount;
* * if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givecash <playerid> <amount>");
* * else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not found!");
* * else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "ERROR: Insufficient funds!");
* * else
* * {
* * * * GivePlayerMoney(giveplayerid, amount);
* * * * GivePlayerMoney(playerid, 0 - amount);
* * * * SendClientMessage(playerid, 0x00FF00AA, "INFO: You have sent money.");
* * * * SendClientMessage(giveplayerid, 0x00FF00AA, "INFO: You have received money.");
* * }
* * return 1;
}
Got this compiled , but when i use /givecash in game its an unknown command? :S pls help
Re: Unknown command ?? :S -
RedJohn - 15.07.2012
Use
It will be better!
Re: Unknown command ?? :S -
xRotem - 15.07.2012
Try
HTML Code:
cmd:givecash(playerid, params[])
Re: Unknown command ?? :S -
Cxnnor - 15.07.2012
Hm, can you use the pawn function so we can know the lines? Thanks.
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by Cxnnor
Hm, can you use the pawn function so we can know the lines? Thanks.
|
done ^^
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by xRotem
Try
HTML Code:
cmd:givecash(playerid, params[])
|
cant compile then
Re: Unknown command ?? :S -
RedJohn - 15.07.2012
Do you have ?
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by RedJohn
|
do i have to add that
(man i'm such a noob xD)
Edit: Still nothing if i add it
Re: Unknown command ?? :S -
Gangster-rocks - 15.07.2012
Download Zcmd i pmed you it
and when to down load it use this
pawn Code:
CMD:Givecash(playerid, params[]) // add this on the end of your script
{
* * new
* * * * giveplayerid,
* * * * amount;
* * if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givecash <playerid> <amount>");
* * else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not found!");
* * else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "ERROR: Insufficient funds!");
* * else
* * {
* * * * GivePlayerMoney(giveplayerid, amount);
* * * * GivePlayerMoney(playerid, 0 - amount);
* * * * SendClientMessage(playerid, 0x00FF00AA, "INFO: You have sent money.");
* * * * SendClientMessage(giveplayerid, 0x00FF00AA, "INFO: You have received money.");
* * }
* * return 1;
}
Re: Unknown command ?? :S -
Djole1337 - 15.07.2012
dcmd is old... Use zcmd, easy to create, also fastest command processor.
Re: Unknown command ?? :S -
prefex - 15.07.2012
Ah ok ill try later
not on my pc now ^
Re: Unknown command ?? :S -
Gangster-rocks - 15.07.2012
It Works fine to me why its won't work with ya.
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by Mr_DjolE
dcmd is old... Use zcmd, easy to create, also fastest command processor.
|
for you its easy yeh xD not for me lowlz
Re: Unknown command ?? :S -
RedJohn - 15.07.2012
Quote:
Originally Posted by Mr_DjolE
dcmd is old... Use zcmd, easy to create, also fastest command processor.
|
or ycmd!
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by Gangster-rocks
It Works fine to me why its won't work with ya.
|
i wish i knew
i just named it givecash compiled it ,, dragged both files to my filterscripts and added it under filterscripts in my config ..
now if i use /givecash id amount , it just says server unknown command
Re: Unknown command ?? :S -
RedJohn - 15.07.2012
That happened to me while i was using
strcmp and
zcmd at same time! Try to have only one processor !
Re: Unknown command ?? :S -
MoNeY_Co0oLzZz - 15.07.2012
Use zcmd...
It works PERFECT!!
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by RedJohn
That happened to me while i was using strcmp and zcmd at same time! Try to have only one processor !
|
lol this is chinees xD
Re: Unknown command ?? :S -
RedJohn - 15.07.2012
Quote:
Originally Posted by prefex
lol this is chinees xD
|
lol?
Re: Unknown command ?? :S -
prefex - 15.07.2012
Quote:
Originally Posted by MoNeY_Co0oLzZz
Use zcmd...
It works PERFECT!!
|
then i have to add a line with define zcmd right??
what line would that be then ? xD