Converting from ZCMD to Strcmp
#1

How to make this able to convert from ZCMD to Strcmp, I believe that it's possible.

Код:
#include <a_samp>

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Converter");
	print("--------------------------------------\n");
	return 1;
}

public OnRconCommand(cmd[])
{
	if (!strcmp(cmd, "convertzcmd", true))
	{
	    new File:file = fopen("commands2convert.txt", io_read);
	    if (file)
	    {
	        new line[512];
	        while (fread(file, line))
	        {
	            if (strfind(line, "strcmp", true) != -1)
	            {
	                new cmdchar = -1;
	                for(new s; s < strlen(line); s++)
	                {
	                    if (line[s] == '/')
	                    {
	                        cmdchar = s;
	                        break;
	                    }
	                }
	                if (cmdchar != -1 && line[cmdchar+1] != '/')
	                {
	                    new File:c;
			            if (!fexist("convertedcommands.txt")) c = fopen("convertedcommands.txt", io_write);
						else c = fopen("convertedcommands.txt", io_append);
						if ©
						{
						    new cmdname[32];
						    format(cmdname, sizeof cmdname, "%s", line[cmdchar+1]);
						    new end = strfind(cmdname, "\"", true);
						    strdel(cmdname, end, strlen(cmdname));
						    new findbracket = strfind(line, "{", true, cmdchar);
							format(line, sizeof line, "CMD:%s(playerid, params[])", cmdname);
						    if (findbracket != -1) strins(line, "\n{", strlen(line));
						    strins(line, "\n", strlen(line));
							fwrite(c, line);
							fclose©;
							continue;
						}
	                }
	            }
	            new File:c;
	            if (!fexist("convertedcommands.txt")) c = fopen("convertedcommands.txt", io_write);
				else c = fopen("convertedcommands.txt", io_append);
				if ©
				{
					fwrite(c, line);
					fclose©;
				}
	        }
	    }
	}
	return 1;
}
help me and ya get a reputation
Reply
#2

any help?
Reply
#3

u mean from strcmp to zcmd? it would be pretty funny the other way around..
so did u put all ur cmds in commands2convert.txt and send rcon convertzcmd?
Reply
#4

dude I meant from ZCMD to Strcmp.. I want to replace some stuff in the script to make this happen
Reply
#5

any help will be appreciated buddies!
Reply
#6

come on guys!
Reply
#7

you can do it manual, just change zcmd stuff to strcmp.
pawn Код:
CMD:command(playerid, params[])
{
SendClientMessage(playerid,RED,"yo");
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/command", true) == 0)
{
SendClientMessage(playerid,RED,"yo");
return 1;
}
Reply
#8

Quote:
Originally Posted by fireboy
Посмотреть сообщение
you can do it manual, just change zcmd stuff to strcmp.
pawn Код:
CMD:command(playerid, params[])
{
SendClientMessage(playerid,RED,"yo");
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/command", true) == 0)
{
SendClientMessage(playerid,RED,"yo");
return 1;
}
Stupid dick head

That u gave an a easier example i know he know

Did u joke?
Reply
#9

dont call someone a dickhead, if he is trying to help you if you got this from a filterscript READ BELOW!


Step 1 : make a folder called commands2convert.txt in your scriptfiles
Step 2 : add your whole onplayercommandtext or just 1 command you want to convert in there
Step 3 : run your server
Step 4 : Load the fliterscript
Step 5 : in console type convertzcmd
Step 6 : your done in scriptfiles you should get a file called convertedcommands.txt which the ZCMD commands converted are in there
Reply
#10

Код:
CMD:command(playerid, params[])
{
SendClientMessage(playerid,RED,"yo");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)