Make command with 2 slashes // [test]
#1

Hi,

How to make (write) command that i could get params when player write 2 slashes not 1 because now in zcmd if i do like this:

Код:
CMD:givemoney(playerid, params[])
{
return 1;
}
i will have to write this command like this: /givemoney

But if i want to make //givemoney

Код:
CMD:/givemoney(playerid, params[])
{
return 1;
}
It give my syntax errors
Reply
#2

I'm not exactly sure how do u do it in zcmd, but using OnPlayerCommandText is it simple, I guess.... Never tested myself
Reply
#3

But if i'am using zcmd it's possible to use onplayercommandtext and make that?
Reply
#4

Use "strcmp" under OnPlayerCommandText

Код:
example:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmd, "//imanoob", true))
{
    SendClientMessage(playerid, 0xFFFFFF, "Yep!");
}
return 1;
}
Reply
#5

It's compatible with zcmd?
Reply
#6

When you use zcmd, onplayercommandtext won't work
Reply
#7

try this:
PHP код:
public OnPlayerText(playeridtext[])
{
    if(!
strcmp("//givemoney"texttrue))  //check if player type //givemoney
    
{
       
//your code ///////////
       
return 0//wont send message: //givemoney
    
}
    return 
1;

Reply
#8

it's possible get params? i mean id what he write or name money

//givemoney [player name/id] [money]
Reply
#9

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
it's possible get params? i mean id what he write or name money

//givemoney [player name/id] [money]
Yep , use sscanf2
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)