Make command.
#1

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

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

------
Reply
#4

Quote:

#include zcmd

CMD:givecash(playerid,params[])
{

This.
Reply
#5

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

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

Reply
#7

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

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

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 .
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)