SA-MP Forums Archive
Make command. - 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: Make command. (/showthread.php?tid=601289)



Make command. - CSCripMa - 19.02.2016

Hi,

How to make with zcmd that player can write 2 slashes and then text with parameters or no now is that


/givemoney Player

I want to make smth

// Player

(Using zcmd)


Re: Make command. - sammp - 19.02.2016

Код:
CMD:/(playerid, params[]){}



Re: Make command. - ratxrat - 19.02.2016

------


Re: Make command. - Joron - 19.02.2016

Quote:

#include zcmd

CMD:givecash(playerid,params[])
{

This.


Re: Make command. - CSCripMa - 19.02.2016

Код:
error 001: expected token: "(", but found "/"
 error 001: expected token: ";", but found "(
Код:
CMD:/(playerid, params[]){}



Re: Make command. - JamalMaddox - 19.02.2016

PHP код:
CMD:/welcome(playeridparams[])
{
SendClientMessage(playeridCOLOR_WHITE "Welcome");
return 
1;




Re: Make command. - CSCripMa - 19.02.2016

But i want to get params.. It's by same as make simple command with one slash / [message] but i with too slashes // [message]


Re: Make command. - Catalyst- - 19.02.2016

You just needed to modify the ZCMD include a little. Replace your existing ZCMD include with this.

For commands with double slash, use:
pawn Код:
CMD2:test(playerid, params[]) {
    return 1;
}



Re: Make command. - nezo2001 - 19.02.2016

PHP код:
CMD:givecash(playeridparams[]) {
new 
targetidvalue;
if(
sscanf(params,"ui",targetidvalue)) return SendClientMessage(playerid, -1"/givecash [ID] [Value]";
if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"This player is not connected to the server!");
GivePlayerMoney(targetidvalue);
return 
1;

You can know what do you want to know from here .


Re: Make command. - Write - 19.02.2016

What the fuck is wrong with you people lol.

pawn Код:
CMD:/givemoney(playerid, params[])
{
    new
        id, amount;
    if(sscanf(params,"ui",id, amount)) return SendClientMessage(playerid, -1, "//givemoney [id] [amount]";
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "No such player.");
    GivePlayerMoney(id, amount);
    return 1;
}