SA-MP Forums Archive
Where to put ZCMD commands? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Where to put ZCMD commands? (/showthread.php?tid=253427)



Where to put ZCMD commands? - Osviux - 06.05.2011

I never tried using ZCMD before, but i know its much better and i want to replace all my simple commands with ZCMD, i tried remaking a simple command, but i dont know where to put it.

Код:
CMD:rules(playerid, params[])
{
ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Rules","Rules\nRules","Rinktis","Iseiti");
return 1;
}



Re: Where to put ZCMD commands? - steki. - 06.05.2011

Bottom of the script, off any callbacks.

The same is valid for y_commands.


Re: Where to put ZCMD commands? - [SFA]SpiRRiT - 06.05.2011

So what you're trying to say is, you don't know where to put those commands?
Well, it doesn't matter where you put them.. They can be placed everywhere!

See ya,


Re: Where to put ZCMD commands? - Skaizo - 06.05.2011

hmmm with
pawn Код:
public OnPlayerCommandReceived( playerid, cmdtext[] )
{
        return 1;
}
CMD:rules(playerid, params[])
{
ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Rules","Rules\nRules","Rinktis","Iseiti");
return 1;
}
is not?


Re: Where to put ZCMD commands? - Rock_Ro - 06.05.2011

Anywhere in your script except callbacks.


Re: Where to put ZCMD commands? - Osviux - 06.05.2011

Okay, and how do i remake more complex commands like this one? I get errors for it.

Код:
 	CMD:papildyti(playerid, params[])
		{
		   	if(cmdtext[10]==0 || !IsNumeric(cmdtext[7]))
		   	{
				SendClientMessage(playerid,COLOR,"{FF0000}* Papildyti saskaita: {00FF00}/papildyti [kiek]");
				return 1;
			}

			new kiek = StringToInt(cmdtext[7]);

			if(playerDB[playerid][papildymas] < kiek)
			{
				SendClientMessage(playerid,COLOR,"{00FF00}* Tu tiek neturi!");
				return 1;
			}

			playerDB[playerid][papildymas]-=kiek;
			playerDB[playerid][mobsas]+=kiek;
			return 1;
		}
Код:
C:\Documents and Settings\Labas\Desktop\GM\gamemodes\GM.pwn(3189) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Labas\Desktop\GM\gamemodes\GM.pwn(3189) : warning 215: expression has no effect
C:\Documents and Settings\Labas\Desktop\GM\gamemodes\GM.pwn(3189) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Labas\Desktop\GM\gamemodes\GM.pwn(3189) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Labas\Desktop\GM\gamemodes\GM.pwn(3189) : fatal error 107: too many error messages on one line