rep + -
oscar7610 - 23.04.2012
Hi can I use zcmd commands and if (strcmp("/command", cmdtext, true, 10) == 0)
at the same time?
Re: rep + -
SupremeCommander - 23.04.2012
No, Only one command processor can be used at a time
Re: rep + -
RollTi - 23.04.2012
Quote:
Originally Posted by SupremeCommander
No, Only one command processor can be used at a time
|
Yes you can by using OnPlayerCommandRecieved/Performed
Re: rep + -
oscar7610 - 23.04.2012
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;
}
Re: rep + -
[GF]Logic - 23.04.2012
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
Re: rep + -
SupremeCommander - 23.04.2012
I suggest you use ZCMD, It's faster and much easier than strcmp...
Re: rep + -
RollTi - 23.04.2012
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
Re: rep + -
[GF]Logic - 23.04.2012
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
Re: rep + -
oscar7610 - 23.04.2012
rep + all thanks. last question but if (strcmp("/command", cmdtext, true, 10) == 0) isnt bad? isnt it?
Re: rep + -
[GF]Logic - 23.04.2012
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