#1

Hi can I use zcmd commands and if (strcmp("/command", cmdtext, true, 10) == 0)

at the same time?
Reply
#2

No, Only one command processor can be used at a time
Reply
#3

Quote:
Originally Posted by SupremeCommander
Посмотреть сообщение
No, Only one command processor can be used at a time
Yes you can by using OnPlayerCommandRecieved/Performed
Reply
#4

Quote:
Originally Posted by SupremeCommander
Посмотреть сообщение
No, Only one command processor can be used at a time
what do you suggest me to use? If zcmd do I need to paste them underneath onplayercommandtext?

like CMD:hello(playerid, params[])
{

SendClientMessage(playerid, 0xFA0505FF,"hello");
return 1;
}
Reply
#5

no you can't ZCMD and Dcmd and Ycmd and other processors have there own way except in the code ofocourse
if (strcmp("/command", cmdtext, true, 10) == 0)
have it's own way and style as you can see
Reply
#6

I suggest you use ZCMD, It's faster and much easier than strcmp...
Reply
#7

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
what do you suggest me to use? If zcmd do I need to paste them underneath onplayercommandtext?

like CMD:hello(playerid, params[])
{

SendClientMessage(playerid, 0xFA0505FF,"hello");
return 1;
}
You cannot use OnPlayerCommandText example you put strcmp OnPlayerCommandText
and use zcmd at the same time your strcmp command will be command unknown so use
OnPlayerCommandRecieved/Performed when going to use strcmp

and remove OnPlayerCommandText you can use ZCMD everywhere except before include <a_samp> and before other includes and also don't put zcmd command inside a public callback
Reply
#8

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
what do you suggest me to use? If zcmd do I need to paste them underneath onplayercommandtext?

like CMD:hello(playerid, params[])
{

SendClientMessage(playerid, 0xFA0505FF,"hello");
return 1;
}
you can by doing this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Hello", cmdtext, true, 10) == 0)
    {
        SendClientMessageToAll(playerid, 0xFA0505FF,"hello");
        return 1;
    }
    return 0;
}
The "Hello" word will be send to all of the server and it would be cool to use ZCMD or DCMD cuz you can make only admins make it like
pawn Код:
CMD:hello(playerid, params[])
{
    if (!IsPlayerAdmin(playerid)) return 0;
    SendClientMessageToAll(playerid, 0xFA0505FF,"hello");
    return 1;
}
if the function SendClientMessageToAll is wrong sorry cuz i didn't use it in my scripting so
Reply
#9

rep + all thanks. last question but if (strcmp("/command", cmdtext, true, 10) == 0) isnt bad? isnt it?
Reply
#10

No It's Not bad but for me i use dcmd or zcmd i feel it's better simple and better than OnPlayerCommandText i don't use it cuz some times i don't even need it in my gamemode so i simply delete it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)