Unknown command ?? :S
#1

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
Reply
#2

Use
PHP Code:
 [pawn] [/pawn
It will be better!
Reply
#3

Try
HTML Code:
cmd:givecash(playerid, params[])
Reply
#4

Hm, can you use the pawn function so we can know the lines? Thanks.
Reply
#5

Quote:
Originally Posted by Cxnnor
View Post
Hm, can you use the pawn function so we can know the lines? Thanks.
done ^^
Reply
#6

Quote:
Originally Posted by xRotem
View Post
Try
HTML Code:
cmd:givecash(playerid, params[])
cant compile then
Reply
#7

Do you have ?
pawn Code:
#include <zcmd>
Reply
#8

Quote:
Originally Posted by RedJohn
View Post
Do you have ?
pawn Code:
#include <zcmd>
do i have to add that (man i'm such a noob xD)

Edit: Still nothing if i add it
Reply
#9

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;
}
Reply
#10

dcmd is old... Use zcmd, easy to create, also fastest command processor.
Reply
#11

Ah ok ill try later not on my pc now ^
Reply
#12

It Works fine to me why its won't work with ya.
Reply
#13

Quote:
Originally Posted by Mr_DjolE
View Post
dcmd is old... Use zcmd, easy to create, also fastest command processor.
for you its easy yeh xD not for me lowlz
Reply
#14

Quote:
Originally Posted by Mr_DjolE
View Post
dcmd is old... Use zcmd, easy to create, also fastest command processor.
or ycmd!
Reply
#15

Quote:
Originally Posted by Gangster-rocks
View Post
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
Reply
#16

That happened to me while i was using strcmp and zcmd at same time! Try to have only one processor !
Reply
#17

Use zcmd...
It works PERFECT!!
Reply
#18

Quote:
Originally Posted by RedJohn
View Post
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
Reply
#19

Quote:
Originally Posted by prefex
View Post
lol this is chinees xD
lol?
Reply
#20

Quote:
Originally Posted by MoNeY_Co0oLzZz
View Post
Use zcmd...
It works PERFECT!!
then i have to add a line with define zcmd right??
what line would that be then ? xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)