Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
zProfessional - 27.11.2012
For ZCMD
hey guys im gonna tell you how to make some simple command useing zcmd or OnPlayerCommandText
you will need this include file
https://sampforum.blast.hk/showthread.php?tid=91354
1.Open Pawno Application
PHP код:
C:\Users\99Boy\Desktop\SAMP Files\Tool\pawno
2.Click New
then
write this following
for the making of command
For example, you have /something cmd:
use this
PHP код:
CMD:mycommand(playerid,params[])
or
PHP код:
COMMAND:mycommand(playerid,params[])
If you want to use zcmd in a filterscript, put this before including all
PHP код:
#define filterscript
If you want to check parameters string is empty you should not do it like:
PHP код:
if (!strlen(params))
{
// no parameters
}
here is some example of command
PHP код:
#define FILTERSCRIPT
#include <zcmd>
CMD:healme(playerid,params[])
{
SetPlayerHealth(playerid, 100.00);
GivePlayerMoney(playerid,-5000);
SendClientMessage(playerid, 0xFFFFFF, "You Have Been Healed By Heal System.");
return 1;
}
or
PHP код:
#define FILTERSCRIPT
#include <zcmd>
COMMAND:armourme(playerid,params[])
{
SetPlayerArmour(playerid, 100.00);
GivePlayerMoney(playerid,-5000);
SendClientMessage(playerid, 0xFFFFFF, "You Have Been Given A Armour By Armour System.");
return 1;
}
For OnPlayerCommandText
PHP код:
1.Open Pawno Application
C:\Users\99Boy\Desktop\SAMP Files\Tool\pawno
2.Click New
to create OnPlayerCommandText Command
you need to write this
in top of command
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
for the command you need to write this for example
PHP код:
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
now for command
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gun", cmdtext, true, 10) == 0)
{
//GivePlayerWeapon(playerid,Weaponid,Ammo);
GivePlayerWeapon(playerid,23,999);
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid, 0xFFFFFF, "You Have Been Given A 9mm Pistol With 999 Ammo.");
return 1;
}
return 0;
}
now When Creating "SendClientMessage"
copy this
PHP код:
SendClientMessage(playerid, COLOR_RED, "Write Your Message Here
Thats All For My Tutorial Have A Nice Scripting Day
You Have Been Healed By Heal System.
Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
Roddan - 27.11.2012
You should explain more.
Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
Michael_Cuellar - 27.11.2012
nothing different from all the others
Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
jstowe96 - 28.11.2012
Could use more effort...
Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
CrazyChoco - 01.12.2012
Indeed
Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) -
Kells - 26.10.2013
Yay man Thank u +rep you really helped me that worked for me