SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 24/02/2012, 07:48 PM   #1
jtemple042996
Big Clucker
 
Join Date: Jul 2011
Posts: 59
Reputation: 1
Default ZCMD Commands

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");
}
jtemple042996 is offline   Reply With Quote
Old 24/02/2012, 08:07 PM   #2
Babul
High-roller
 
Babul's Avatar
 
Join Date: Sep 2009
Location: in a cement block
Posts: 1,781
Reputation: 266
Default Re: ZCMD Commands

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' ^^
__________________
FireWorks

new sscanf2 custom specifiers available for Download, read the Release Topic
Babul is offline   Reply With Quote
Old 24/02/2012, 08:36 PM   #3
jtemple042996
Big Clucker
 
Join Date: Jul 2011
Posts: 59
Reputation: 1
Default Re: ZCMD Commands

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
jtemple042996 is offline   Reply With Quote
Old 26/02/2012, 11:14 PM   #4
jtemple042996
Big Clucker
 
Join Date: Jul 2011
Posts: 59
Reputation: 1
Default Re: ZCMD Commands

Any idea how to fix this, i added the return 1; value to the end of the function and still no luck
jtemple042996 is offline   Reply With Quote
Old 26/02/2012, 11:34 PM   #5
FalconX
Gangsta
 
FalconX's Avatar
 
Join Date: Mar 2011
Location: Kuwait
Posts: 633
Reputation: 103
Default Re: ZCMD Commands

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
__________________
^
FalconX is offline   Reply With Quote
Old 27/02/2012, 12:09 AM   #6
jtemple042996
Big Clucker
 
Join Date: Jul 2011
Posts: 59
Reputation: 1
Default Re: ZCMD Commands

Still wont work i removed the OnPlayerCommandText
jtemple042996 is offline   Reply With Quote
Old 27/02/2012, 12:22 AM   #7
FalconX
Gangsta
 
FalconX's Avatar
 
Join Date: Mar 2011
Location: Kuwait
Posts: 633
Reputation: 103
Default Re: ZCMD Commands

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
__________________
^
FalconX is offline   Reply With Quote
Old 27/02/2012, 01:08 AM   #8
jtemple042996
Big Clucker
 
Join Date: Jul 2011
Posts: 59
Reputation: 1
Default Re: ZCMD Commands

I removed the line in quote, no compiling errors, just Server: Unknown Command
jtemple042996 is offline   Reply With Quote
Old 27/02/2012, 01:15 AM   #9
FalconX
Gangsta
 
FalconX's Avatar
 
Join Date: Mar 2011
Location: Kuwait
Posts: 633
Reputation: 103
Default Re: ZCMD Commands

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
__________________
^
FalconX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] STRCMP and ZCMD - how to change your commands to ZCMD Swyft Tutorials 12 14/01/2015 09:58 PM
[FilterScript] Login/Register using ZCMD SSCANF & Y_INI.( Admin commands + VIP System + VIP Commands! ) Zh3r0 Filterscripts 116 09/01/2015 10:57 AM
Where to put ZCMD commands? Osviux Help Archive 5 06/05/2011 04:34 PM
DCMD Commands not working after adding some ZCMD commands :S [L3th4l] Help Archive 4 20/01/2010 09:57 PM
ZCMD 2 commands rcwarez Help Archive 6 14/12/2009 07:02 PM


All times are GMT. The time now is 05:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.