SA-MP Forums Archive
How!? - 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: How!? (/showthread.php?tid=244482)



How!? - Mr_Scripter - 27.03.2011

How To Make Commands Using Zcmd i tried this but not working
pawn Код:
CMD:Cmds(playerid,params[])
{
    return SendClientMessage(playerid,blue,"kill");
}
when i type /cmds it says server unkown command


Re: How!? - kemppis_ - 27.03.2011

try
pawn Код:
CMD:cmds(playerid,params[])
{
    return SendClientMessage(playerid,blue,"kill");
}
and then type /cmds


Re: How!? - Mr_Scripter - 27.03.2011

the problem was "C" ?i wrote it on Caps?


Re: How!? - Mr_Scripter - 27.03.2011

pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(660) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
What's The Problem?
pawn Код:
CMD:cmds(playerid,params[])
{
    return SendClientMessage(playerid,blue,"~~Availible Commands~~");
    return SendClientMessage(playerid,green,"Kill");
}



Re: How!? - kemppis_ - 27.03.2011

pawn Код:
CMD:cmds(playerid,params[])
{
     SendClientMessage(playerid,blue,"~~Availible Commands~~");
     SendClientMessage(playerid,green,"Kill");
}
try that


Re: How!? - [L3th4l] - 27.03.2011

Pay attention at the command structures, as well as how you properly use the return statement.

pawn Код:
CMD:cmds(playerid, params[])
{
    SendClientMessage(playerid,blue,"~~Availible Commands~~");
    SendClientMessage(playerid,green,"Kill");
    return 1;
}



Re: How!? - Mr_Scripter - 27.03.2011

if it's One line then
pawn Код:
return SendClient................
If it's 2 Lines
pawn Код:
SendClinetMessage........
SendClientMessage...................
return 1;
}



Re: How!? - kemppis_ - 27.03.2011

This look better on server ->
pawn Код:
CMD:cmds(playerid, params[])
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"~~Availible Commands~~","Kill","Ok","Cancel");
    return 1;
}
if you wanna add more commands, do it like "kill\nNEW COMMAND\n etc...
\n = new line


Re: How!? - Austin - 27.03.2011

You could do it either way Mr_Scripter. The return is just what is returned to the function that called cmds.

https://sampwiki.blast.hk/wiki/SendClientMessage

return SendClientMessage means nothing. If you were returning something like a TeamID or name, then the other function might use it.

zcmd is only looking for a true value I believe, not specifics.