How to make Commands with ZCMD and how to use it -
PrinceEpilogue - 25.07.2013
Hello Ladies and Gentlemen, I'll make a tutorial, If it's bad just say it in reply without -rep
Today, I'll Teach you how to make ZCMD Commands
Of course you must have ZCMD
Notice: Please read all the thread dont ignore it to see if its good or no
First: We'll make Kill Command:
It must seems Like that Because you use the ZCMD
Code:
CMD:kill(playerid, params[])
Now how we make it gives low hp ?
We'll have to make that
Code:
CMD:kill(playerid, params[])
SetPlayerHealth(playerid,0);
Of course the 0 Reffers that when you type /kill it gives you 0 Hp
And Lets make the Heal command
Very very easy
Put that in another line
CMD:kill(playerid, params[])
And the 0, make it 100 So it gives you 100 HP
And it should seems like that
Code:
CMD:kill(playerid, params[])
SetPlayerHealth(playerid,100); //This's 100, So it'll give you 100 hp<<
Now We'll make /information Command
Very east too
You'll make that
CMD:information(playerid, params[]) // Notice the CMD: Reffers to the ZCMD so you must use it if you have ZCMD
Now Lets make the Command
We'll make it with "SendClientMessage" It's very easy
Look at me
First we'll create that ofcourse
CMD:information(playerid, params[])
We have to do SendClientMessage.
So it must seems like that :
Code:
CMD:information(playerid, params[])
SendClientMessage(playerid, 0xFFFFFF, "Here you type what do you want"); // 0xFFFFFF is the color, You can
change it with any color you want
Notice : Dont forget the
Now we want to make a Radio Command
Easy too
First we must make that
Code:
CMD:playradio(playerid, params[]) // Because it's ZCMD
Now we must do "PlayAudioStreamForPlayer(playerid,"Here the station");
So it must seems like that :
Code:
CMD:playradio(playerid, params[]) // Because it's ZCMD
PlayAudioStreamForPlayer(playerid,"Here the station"); // "Here the station" You put in it your Station IP
You use /playradio to play the radio
If you saw any problems let me edit it please
Re: How to make Commands with ZCMD and how to use it -
SchurmanCQC - 25.07.2013
Why aren't you using brackets? I'm also pretty sure ZCMD requires the return 1.
With the way you explained it, if I was a complete newbie, my command would look like this:
pawn Code:
CMD:playradio(playerid, params[])
PlayAudioStreamForPlayer(playerid,"Here the station");
return 1;
}
Oh, btw, I -repped you. You created this thread with the intentions of getting rep, not helping the community out. (You also had no idea what the hell you were talking about)
pawn Code:
CMD:playradio(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, -1, "Usage: /playradio <url>"),
SendClientMessage(playerid, -1, "Usage: /playradio off to turn it off.");
if(strcmp(params, "off") == 0)
return SendClientMessage(playerid, -1, "You have turned the radio {999999}off{FFFFFF}."),
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, -1, "You have set the {999999}radio station{FFFFFF}.");
PlayAudioStreamForPlayer(playerid, params);
return 1;
}
Re: How to make Commands with ZCMD and how to use it -
Infinity - 25.07.2013
A rushed tutorial that's nothing but awfully bad. I agree with Schurman, this is just an attempt at a quick REP-grab...