SA-MP Forums Archive
Converting... ZCMD to STRCMP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Converting... ZCMD to STRCMP (/showthread.php?tid=393281)



Converting... ZCMD to STRCMP - NeroX98 - 17.11.2012

Can someone convert me this command into STRCMP... ?

Код:
CMD:makesaleveh(playerid, params[])
{
	new vrsta,model,boja1,boja2,cijena;
	if (sscanf(params, "ddddd",vrsta,model,boja1,boja2,cijena)) SCM(playerid, COLOR_WHITE, "Koristenje: /makesaleveh [vrsta] [ModelID] [boja1] [boja2] [cijena]");
	else if(vrsta < 0 || vrsta > 3)  SCM(playerid, COLOR_LIGHTGREEN, "Vrste: 0-Auto,1-Motor,2-Brod,3-Avion");
	else if(model < 400 || model > 611)  SCM(playerid, COLOR_WHITE, "Model vozila nemoze biti ispod 400 i preko 611!");
	else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
	else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
	else if(cijena < 1 || cijena > 99999999)  SCM(playerid, COLOR_WHITE, "Cijena nemoze biti ispod 0!");
	else
	{
	    if(IsPlayerAdmin(playerid))
	    {
			new Float:X,Float:Y,Float:Z,Float:A, s;
			GetPlayerPos(playerid, X,Y,Z);
		 	s = MakeXDCarFnc(playerid,vrsta,model,X+1.5,Y+2.5,Z+2.0,A,boja1,boja2,"Nitko");//THREAD-0=car=bike,2=boat,3=air
		 	MyVehicle[s][MyVehFsale] = cijena;
			SCM(playerid, COLOR_LIGHTRED, "Stvorio si vozilo za prodaju!");
			printf("TYP:%d, ID:%d",vrsta,s);
			UpdateMyVehSystem(s);
		}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
	}
	return 1;
}

I tried something like this but it has a lot of bugs and didn't worked...
Код:
	if(strcmp(cmdtext, "/makesaleveh", true) == 0)
	{
		new vrsta,model,boja1,boja2,cijena;
		new x_saleveh[256];
		x_saleveh = strtok(cmdtext, idx);
		if(!strlen(x_saleveh))
		{
			SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /makesaleveh [vrsta] [ModelID] [boja1] [boja2] [cijena]");
			if(vrsta < 0 || vrsta > 3)  SendClientMessage(playerid, COLOR_LIGHTGREEN, "Vrste: 0-Auto,1-Motor,2-Brod,3-Avion");
			else if(model < 400 || model > 611)  SendClientMessage(playerid, COLOR_WHITE, "Model vozila nemoze biti ispod 400 i preko 611!");
			else if(boja1 < 0 || boja1 > 126)  SendClientMessage(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
			else if(boja2 < 0 || boja2 > 126)  SendClientMessage(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
			else if(cijena < 1 || cijena > 99999999)  SendClientMessage(playerid, COLOR_WHITE, "Cijena nemoze biti ispod 0!");
		}
	 	if(IsPlayerAdmin(playerid))
		{
			new Float:X,Float:Y,Float:Z,Float:A, s;
			GetPlayerPos(playerid, X,Y,Z);
	 		s = MakeXDCarFnc(playerid,vrsta,model,X+1.5,Y+2.5,Z+2.0,A,boja1,boja2,"Nitko");//THREAD-0=car=bike,2=boat,3=air
	 		MyVehicle[s][MyVehFsale] = cijena;
			SendClientMessage(playerid, COLOR_LIGHTRED, "Stvorio si vozilo za prodaju!");
			printf("TYP:%d, ID:%d",vrsta,s);
			UpdateMyVehSystem(s);
		}
		else
		{
			SendClientMessage(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");
		}
		return 1;
	}



Re: Converting... ZCMD to STRCMP - Ballu Miaa - 17.11.2012

Are you insane? Why are you converting a zcmd into strcmp?

ZCMD is the one of the fastest command processors and strcmp fails so bad!


Re: Converting... ZCMD to STRCMP - NeroX98 - 17.11.2012

Yea i know... But how the fck can i convert 100 STRCMP commands into ZCMD... ?


Re: Converting... ZCMD to STRCMP - NewerthRoleplay - 17.11.2012

Don't you can still have both lol


Re: Converting... ZCMD to STRCMP - NeroX98 - 17.11.2012

no i can't... When i load this ZCMD as filterscript i can, but i want it in gamemode... When i add in gamemode than it won't work...


Respuesta: Converting... ZCMD to STRCMP - ThePhenix - 17.11.2012

First calm down. If you are here to be angry, nobody is going to help you.
Is not hard to conver STRCMP to ZCMD.


Re: Respuesta: Converting... ZCMD to STRCMP - NeroX98 - 17.11.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
First calm down. If you are here to be angry, nobody is going to help you.
Is not hard to conver STRCMP to ZCMD.
Hehe im not angry... Just my english is poor

Is there any easy way to convert all commands from strcmp into zcmd ?


Re: Respuesta: Converting... ZCMD to STRCMP - Riddick94 - 17.11.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
First calm down. If you are here to be angry, nobody is going to help you.
Is not hard to conver STRCMP to ZCMD.
Thank you for your advice, the first thing what we need is: "That is not hard". Now close the doors but from the other side, Thank you.

Quote:
Originally Posted by NeroX98
can i convert 100 STRCMP commands into ZCMD... ?
Quote:
Originally Posted by NeroX98
Can someone convert me this command into STRCMP... ?
Determine what do you want.


Re: Respuesta: Converting... ZCMD to STRCMP - NeroX98 - 17.11.2012

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Thank you for your advice, the first thing what we need is: "That is not hard". Now close the doors but from the other side, Thank you.



Determine what do you want.
First, i want someone to convert this command into STRCMP, cause i have a lot of commands with STRCMP and i can't convert them all to ZCMD.

Second, if there is any easiest way to covert all STRCMP commands to ZCMD than post how to


Re: Converting... ZCMD to STRCMP - Riddick94 - 17.11.2012

Easier way is just convert from string compare to ZeeX's Command processor which is easier to use and better in saving memory and of course a lot faster.

Always if you have got a problem, you MUST check for the same problem on the forum by using forum search function or ****** site.

https://sampforum.blast.hk/showthread.php?tid=280387 - Tutorial how to convert.