[Tutorial] Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)
#1

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
PHP код:
#include <zcmd> 
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(playerid100.00);
      
GivePlayerMoney(playerid,-5000);
      
SendClientMessage(playerid0xFFFFFF"You Have Been Healed By Heal System.");
      return 
1;

or
PHP код:
#define FILTERSCRIPT
#include <zcmd>
COMMAND:armourme(playerid,params[])
{
      
SetPlayerArmour(playerid100.00);
      
GivePlayerMoney(playerid,-5000);
      
SendClientMessage(playerid0xFFFFFF"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(playeridcmdtext[]) 
for the command you need to write this for example
PHP код:
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
0;

now for command

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/gun"cmdtexttrue10) == 0)
    {
        
//GivePlayerWeapon(playerid,Weaponid,Ammo);
        
GivePlayerWeapon(playerid,23,999);
                      
GivePlayerMoney(playerid,-500);
                      
SendClientMessage(playerid0xFFFFFF"You Have Been Given A 9mm Pistol With 999 Ammo.");
                      return 
1;
    }
    return 
0;

now When Creating "SendClientMessage"
copy this
PHP код:
SendClientMessage(playeridCOLOR_RED"Write Your Message Here 
Thats All For My Tutorial Have A Nice Scripting Day
You Have Been Healed By Heal System.
Reply
#2

You should explain more.
Reply
#3

nothing different from all the others
Reply
#4

Could use more effort...
Reply
#5

Indeed
Reply
#6

Yay man Thank u +rep you really helped me that worked for me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)