#1

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

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

the problem was "C" ?i wrote it on Caps?
Reply
#4

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");
}
Reply
#5

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

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

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

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
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)