Posts: 220
Threads: 62
Joined: Aug 2009
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;
}
Posts: 2,557
Threads: 77
Joined: Nov 2010
Reputation:
0
Bottom of the script, off any callbacks.
The same is valid for y_commands.
Posts: 134
Threads: 5
Joined: Dec 2010
Reputation:
0
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,
Posts: 222
Threads: 18
Joined: Mar 2011
Reputation:
0
Anywhere in your script except callbacks.
Posts: 220
Threads: 62
Joined: Aug 2009
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