Where to put ZCMD commands?
#1

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;
}
Reply
#2

Bottom of the script, off any callbacks.

The same is valid for y_commands.
Reply
#3

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,
Reply
#4

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?
Reply
#5

Anywhere in your script except callbacks.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)