How to create an command without "zcmd" -
Jaggy - 28.01.2013
To create a command with out "zcmd".inc
1. Create / load your script
2. then you must go bellow
and you will find :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
or if you don't find it and you already removed it then write it again
3. replace the /mycommand with your command
4. and replace the //do something here with your command action
5. and if you compelete it press (compile/run)
(NOTE): if you have some errors tell me
and if you want to add other and other commands
you have make likethis :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0)
return 1;
}
return 0;
}
so you must add to the :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0)
return 1;
}
return 0;
}
add like that :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
setplayerhealth(playerid, 0)
return 1;
}
if (strcmp("/healme", cmdtext, true, 10) == 0)
{
setplayerhealth(playerid, 100)
setplayerarmour(playerid, 100)
return 1;
}
return 0;
}
AW: How to create an command without "zcmd" -
Blackazur - 28.01.2013
I dont think that this is an Tutorial, and this is pretty simple self for Beginners. You should too say what they cause.
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Click me to see on how to post a tutorial ( Credits to Y_Less for topic _
Re: How to create an command without "zcmd" -
Jaggy - 28.01.2013
LoL
HmMm
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Don't remove this, edit this to explain everyone clearly what you're saying!
AW: How to create an command without "zcmd" -
IPrototypeI - 28.01.2013
you can even add to this tutorial where is the different between
pawn Code:
if (strcmp("/healme", cmdtext, true, 10) == 0)
and
pawn Code:
if (!strcmp("/healme", cmdtext)
how to use sscanf or strtok for commands with more parameters.
And if someone don't want to use sscanf to splitt the commandtext then how he get the string of a command
like /a for admin talk. And so on
Re: How to create an command without "zcmd" -
Jaggy - 28.01.2013
do you see what i say in the tutorial?
i say replace the //do something here and make the command (Action)
... it is just for some actions
like :
(actions)
/kill
/drunk
/healme
(name Colors)
/red
/blue
/black
/pink
/purple
/green
/yellow
and other things..
read the tutorial good
Re: How to create an command without "zcmd" -
Luis- - 28.01.2013
But STRCMP is gay, old and slow.
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Quote:
Originally Posted by -Luis
But STRCMP is gay, old and slow.
|
STRCMP is better than you, but before all these command processors were released, you had to use STRCMP, right? You can't just call something bad even if you used it many times before.
Re: How to create an command without "zcmd" -
Jaggy - 28.01.2013
but the STRCMP can make the /slap command too right?
Re: How to create an command without "zcmd" -
Luis- - 28.01.2013
zcmd was released when I started scripting and how is STRCMP better than me?
Re: How to create an command without "zcmd" -
M3mPHi$_S3 - 28.01.2013
This is freaking easy , We also can use it by strcmp
Re: How to create an command without "zcmd" -
Jochemd - 28.01.2013
It's good to learn players how to use strcmp, but not for commands.
Re: How to create an command without "zcmd" -
Jaggy - 28.01.2013

so my thread is good for the newbies?
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Quote:
Originally Posted by -Luis
zcmd was released when I started scripting and how is STRCMP better than me?
|
Ok, but before command processors were even released, scripters had to use strcmp. A advanced scripter can create 'you' in-game using only strcmp.
Re: How to create an command without "zcmd" -
Luis- - 28.01.2013
How can a scripter create me in game?
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Quote:
Originally Posted by -Luis
How can a scripter create me in game?
|
NPC, auto-chat, shoot when being attacked. Basically, the things we do being scripted.
Re: How to create an command without "zcmd" -
Jaggy - 28.01.2013
Luis i'm not a pr0 scripter im medium scripter...
Re: How to create an command without "zcmd" -
Luis- - 28.01.2013
Quote:
Originally Posted by Madeline
NPC, auto-chat, shoot when being attacked. Basically, the things we do being scripted.
|
You said an advanced scripter could create ME in game.
Quote:
Originally Posted by Jaggy
|
I didn't say you was?
Re: How to create an command without "zcmd" -
Madeline - 28.01.2013
Quote:
Originally Posted by Y_Less
Yes you can! If new better alternatives for something exist then the old version is worse than the new version. Just because it was once the best available doesn't make it good.
|
Yes, but you can just give some credits. It's something like it massively helped you before, but now you're betraying it.