ZCMD Commands
#1

My Scripted ZCMD commands and none of them work ingame

CMD:showurl(playerid,params[])
{
SendClientMessageToAll(color_gold,"Visit Our Website, evolutionroleplay.co.uk!");
SendClientMessage(playerid,color_red,"Evolution RPG Website URL has been shown to all users");
}
CMD:showts(playerid,params[])
{
SendClientMessageToAll(color_gold,"Join Teamspeak, 74.64.91.241!");
SendClientMessage(playerid,color_red,"Teamspeak information has been shown to all users");
}
Reply
#2

you need to place a
pawn Code:
return 1;
at each commands' end:
pawn Code:
CMD:showurl(playerid,params[])
{
    SendClientMessageToAll(color_gold,"Visit Our Website, evolutionroleplay.co.uk!");
    SendClientMessage(playerid,color_red,"Evolution RPG Website URL has been shown to all users");
    return 1;
}

CMD:showts(playerid,params[])
{
    SendClientMessageToAll(color_gold,"Join Teamspeak, 74.64.91.241!");
    SendClientMessage(playerid,color_red,"Teamspeak information has been shown to all users");
    return 1;
}
.. coz they act like (afaik they ARE) callbacks. always return somethin' ^^
Reply
#3

Quote:
Originally Posted by Babul
View Post
you need to place a
pawn Code:
return 1;
at each commands' end:
pawn Code:
CMD:showurl(playerid,params[])
{
    SendClientMessageToAll(color_gold,"Visit Our Website, evolutionroleplay.co.uk!");
    SendClientMessage(playerid,color_red,"Evolution RPG Website URL has been shown to all users");
    return 1;
}

CMD:showts(playerid,params[])
{
    SendClientMessageToAll(color_gold,"Join Teamspeak, 74.64.91.241!");
    SendClientMessage(playerid,color_red,"Teamspeak information has been shown to all users");
    return 1;
}
.. coz they act like (afaik they ARE) callbacks. always return somethin' ^^
i fixed that but they still dont run
Reply
#4

Any idea how to fix this, i added the return 1; value to the end of the function and still no luck
Reply
#5

Quote:
Originally Posted by jtemple042996
View Post
Any idea how to fix this, i added the return 1; value to the end of the function and still no luck
You might have OnPlayerCommandText callback (public) in your script, search and remove it as it get's conflicts and the command do not work. Remember when you are using Zcmd, you can't use strcmp with it.

-FalconX
Reply
#6

Still wont work i removed the OnPlayerCommandText
Reply
#7

Quote:
Originally Posted by jtemple042996
View Post
Still wont work i removed the OnPlayerCommandText
make sure you have removed all callback:-

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
        return 1;
    }
// and all commands from here, remove them.
    return 0;
}
Remove the above and just use ZCMD, if you have errors please consider posting it here.

-FalconX
Reply
#8

I removed the line in quote, no compiling errors, just Server: Unknown Command
Reply
#9

Quote:
Originally Posted by jtemple042996
View Post
I removed the line in quote, no compiling errors, just Server: Unknown Command
pawn Code:
CMD:YourCommand(playerid, params[])
{
    SendClientMessage(playerid, -1, "Your command is working.");
    return 1;
}
did you use such way to make commands? If yes then this is a correct way, you should consider sharing your script here so people here and/or me can help you.

Remember they must not be in any callback (publics), they must be anywhere outside of the callbacks.

-FalconX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)