SA-MP Forums Archive
[+REP] STCMP to ZCMD Convert - 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: [+REP] STCMP to ZCMD Convert (/showthread.php?tid=482015)



[+REP] STCMP to ZCMD Convert - SplinteX - 18.12.2013

Hello!

I would really beg someone if he could convert me filterscript STCMP to ZCMD .Im trying to convert it all day but I always get errors,and its hard to understand it.

Here is the download link:

http://www.solidfiles.com/d/76d2b1d9be/

I would really appreciate your help.I give +REP


Re: [+REP] STCMP to ZCMD Convert - Mattakil - 18.12.2013

change OnPlayerCommandText to
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)



Re: [+REP] STCMP to ZCMD Convert - SplinteX - 18.12.2013

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
change OnPlayerCommandText to
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
And what it will do?


Re: [+REP] STCMP to ZCMD Convert - Wizzy951 - 18.12.2013

Check the tutorial in my signature, I hope it will help you.


Re: [+REP] STCMP to ZCMD Convert - SplinteX - 18.12.2013

Quote:
Originally Posted by Wizzy951
Посмотреть сообщение
Check the tutorial in my signature, I hope it will help you.
I always got errors while compiling!

I am a real newbie and its really hard to convert the command like this:

Код:
 if (strcmp(cmd, "/newbuycar", true) ==0 )
	{
	if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, WHITE, "You are not allowed to use this command!");
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp)){return 1;}
	new vehiclemodel = strval(tmp);
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp)){return 1;}
	new color1 = strval(tmp);
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp)){return 1;}
	new color2 = strval(tmp);
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp)){return 1;}
	new price = strval(tmp);
	new Float:px,Float:py,Float:pz,Float:pa;
	GetPlayerPos(playerid,px,py,pz);
	GetPlayerFacingAngle(playerid,pa);
	created++;
	VehicleSystem[created][model]=vehiclemodel;
	VehicleSystem[created][x]=px;
	VehicleSystem[created][y]=py;
	VehicleSystem[created][z]=pz;
	VehicleSystem[created][a]=pa;
	VehicleSystem[created][Farbe1]=color1;
	VehicleSystem[created][Farbe2]=color2;
	VehicleSystem[created][preis]=price;
	VehicleSystem[created][owned]=0;
	VehicleSystem[created][cLock]=1;
	strmid(VehicleSystem[created][owner],"dealercar",0,128,128);
	new ccar = CreateVehicle(VehicleSystem[created][model],VehicleSystem[created][x],VehicleSystem[created][y],VehicleSystem[created][z],VehicleSystem[created][a],VehicleSystem[created][Farbe1],VehicleSystem[created][Farbe2],600000);
	IDIS[ccar]=created;
	SaveTool();
	return 1;
	}



Re: [+REP] STCMP to ZCMD Convert - BlackWolf120 - 18.12.2013

pawn Код:
CMD:newbuycar(playerid,params[])//ZCMD
{
    //as for this command no parameters are required
    #pragma unused params
    //your stuff
    return 1;
}



Re: [+REP] STCMP to ZCMD Convert - Mattakil - 18.12.2013

If you use OnPlayerCommandPerformed, it allows you to use both strcmp and zcmd without issue


Re: [+REP] STCMP to ZCMD Convert - Tayab - 18.12.2013

Converted all the commands for you.

You will need sscanf plugin/include if don't have already.

http://pastebin.com/dYEA59XX


Re: [+REP] STCMP to ZCMD Convert - SplinteX - 18.12.2013

Quote:
Originally Posted by Tayab
Посмотреть сообщение
Converted all the commands for you.

You will need sscanf plugin/include if don't have already.

http://pastebin.com/dYEA59XX
Thanks for your hard work but when I want to compile it my pawno crash and that means something is wrong with script BTW I have sscanf plugin/include in pawno and sscanf in plugins folder


Re: [+REP] STCMP to ZCMD Convert - Tayab - 18.12.2013

Use crashdetect plugin.