I hope someone can help me with this ( I can't explain in title. )
#1

Hello reader,

I lately started using ZCMD and it seems it all works fine, I can script some commands and they work bla bla bla. I always thought that CMD:cmd(playerid, params[]) that the "params" are the player's typed text. So then I tried to create a /help [category] command and this is what happends:
Код:
C:\Users\Administrator\Desktop\samp03dsvr_R2_win32\gamemodes\test2.pwn(384) : error 033: array must be indexed (variable "params")
C:\Users\Administrator\Desktop\samp03dsvr_R2_win32\gamemodes\test2.pwn(393) : error 033: array must be indexed (variable "params")
C:\Users\Administrator\Desktop\samp03dsvr_R2_win32\gamemodes\test2.pwn(404) : error 033: array must be indexed (variable "params")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
This is the scriptcode I use:
pawn Код:
367 CMD:help(playerid, params[])
368 {
369     if (isnull(params))
370     {
371     if (IsPlayerAdmin(playerid) == 1)
372     {
373     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
374     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}General - Roleplay - Admin");
375     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
376     }
377         else if (IsPlayerAdmin(playerid) == 0)
378         {
379     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
380         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}General - Roleplay");
381         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
382         }
383     }
384     if ((params) == " General")
385 {
386     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
387     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| .:{FFFFFF}General commands{FFCC00}:.  |");
388     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}--------------------- {FFCC00}|");
389     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/g - This is used to chat in global OOC chat.");
390     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/pm - This is used to chat in private OOC chat.");
391     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
392     }
393     if ((params) == " Roleplay")
394     {
395     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
396     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| .:{FFFFFF}Roleplay commands{FFCC00}:.  |");
397     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}--------------------- {FFCC00}|");
398     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/me - This is used to create a roleplay sentence.");
399     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/act - This is used to create a roleplay sentence.");
400     SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
401     }
402     if (IsPlayerAdmin(playerid) == 1)
403     {
404         if ((params) == " Admin")
405         {
406         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
407         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| .:{FFFFFF}Admin commands{FFCC00}:.  |");
408         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}--------------------- {FFCC00}|");
409         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/spot - This show other players you are on Administrator duty.");
410         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}/createveh - This is used to create a vehicle.");
411         SendClientMessage(playerid, KLEUR_WIT, "{FFCC00}| {FFFFFF}------------------------------------------------------------------------------------ {FFCC00}|");
412         }
413     }
414             else
415             {
416             SendClientMessage(playerid, KLEUR_WIT, "{B4B5B7}USAGE: /help [category]");
417             }
418     return 1;
419 }
I hope someone can help me with this, I already tried several things and they didn't work out!

Best regards,
Jesse
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)