SA-MP Forums Archive
Unknown command ?? :S - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknown command ?? :S (/showthread.php?tid=359782)

Pages: 1 2


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
PHP Code:
 [pawn] [/pawn
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
View Post
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
View Post
Try
HTML Code:
cmd:givecash(playerid, params[])
cant compile then


Re: Unknown command ?? :S - RedJohn - 15.07.2012

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



Re: Unknown command ?? :S - prefex - 15.07.2012

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


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
View Post
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
View Post
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
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


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
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


Re: Unknown command ?? :S - RedJohn - 15.07.2012

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


Re: Unknown command ?? :S - prefex - 15.07.2012

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