gamemode to convert strcmp to zcmd
#1

I wanted to convert all commands from strcmp to zcmd, some things I know but I do not know if you just change the rows or if I have to appoint new strings:
then change this:
Код:
#include <zcmd>
from
Код:
if(strcmp("/battleground", cmdtext, true) == 0)
to
Код:
CMD:battleground(playerid, params[])
and these will have to change?
Код:
	new string[256];
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	new tmp[256];
	new giveplayer[MAX_PLAYER_NAME];
	new giveplayerid;
	GetPlayerName(playerid,nome,sizeof(nome));
	format(string, sizeof(string), "{54da00}[CMDS-DIRETTO:]{ffffff} %s (%d) ha usato: {ff0000}%s", nome,playerid,cmdtext);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(scmds[i] == 1 && playerid != i)
		    {
				SendClientMessage(i, COLOR_GREY, string);
			}
		}
    }
tanks
Reply
#2

OT: Why you want to do that ? Sorry i am a newbie
Reply
#3

I don't think so mate. They shouldn't have to change and that should work. Been a long time since I scripted but that should work. Try it, if you get errors, post them and we can try and fix them... no harm in trying, that'll give you your answer
Reply
#4

Quote:
Originally Posted by MMAS09
Посмотреть сообщение
OT: Why you want to do that ? Sorry i am a newbie
ZCMD is the fastest command processor around right now, if you have less than 100 commands. Otherwise y_commands is the fastest!

@OP: You'll have to change cmdtext to params, and perhaps even modify strtok a little. I don't use that shit function, and never have, so, don't quote me on that!

BUT, you will definitely have to change cmdtext to params. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)