SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 27/11/2012, 12:21 PM   #1
zProfessional
Big Clucker
 
zProfessional's Avatar
 
Join Date: Nov 2012
Location: In Xtremer's Back
Posts: 166
Reputation: 20
Default Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

For ZCMD

hey guys im gonna tell you how to make some simple command useing zcmd or OnPlayerCommandText

you will need this include file
http://forum.sa-mp.com/showthread.php?t=91354

1.Open Pawno Application
PHP Code:
C:\Users\99Boy\Desktop\SAMP Files\Tool\pawno 
2.Click New

then
write this following
PHP Code:
#include <zcmd> 
for the making of command

For example, you have /something cmd:

use this
PHP Code:
CMD:mycommand(playerid,params[]) 
or
PHP Code:
COMMAND:mycommand(playerid,params[]) 
If you want to use zcmd in a filterscript, put this before including all
PHP Code:
#define filterscript 
If you want to check parameters string is empty you should not do it like:
PHP Code:
if (!strlen(params))
{
  
// no parameters 

here is some example of command
PHP Code:
#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 Code:
#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 Code:
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 Code:
public OnPlayerCommandText(playeridcmdtext[]) 
for the command you need to write this for example
PHP Code:
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
0;

now for command

PHP Code:
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 Code:
SendClientMessage(playeridCOLOR_RED"Write Your Message Here 

Thats All For My Tutorial Have A Nice Scripting Day
You Have Been Healed By Heal System.
__________________

Last edited by zProfessional; 28/11/2012 at 08:12 AM.
zProfessional is offline   Reply With Quote
Old 27/11/2012, 01:23 PM   #2
Roddan
Big Clucker
 
Join Date: Mar 2012
Location: Sweden
Posts: 169
Reputation: 37
Default Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

You should explain more.
Roddan is offline   Reply With Quote
Old 27/11/2012, 10:54 PM   #3
Michael_Cuellar
Big Clucker
 
Michael_Cuellar's Avatar
 
Join Date: Apr 2012
Location: Bullhead City Arizona
Posts: 127
Reputation: 5
Default Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

nothing different from all the others
__________________
www.newera-rp.netne.net

Looking for 2nd scripter
Michael_Cuellar is offline   Reply With Quote
Old 28/11/2012, 04:39 PM   #4
jstowe96
Big Clucker
 
Join Date: May 2012
Posts: 54
Reputation: 3
Default Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

Could use more effort...
__________________
Code:
My works :D

Hilltop Farm Mapping
jstowe96 is offline   Reply With Quote
Old 01/12/2012, 04:23 PM   #5
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 896
Reputation: 35
Default Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

Indeed
CrazyChoco is offline   Reply With Quote
Old 26/10/2013, 02:45 PM   #6
Kells
Big Clucker
 
Kells's Avatar
 
Join Date: Aug 2013
Posts: 154
Reputation: 16
Smile Re: Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners)

Yay man Thank u +rep you really helped me that worked for me
__________________
[SIZE="5"]Kells
Kells 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] Making a simple PM system with ZCMD & sscanf Toni Tutorials 37 07/07/2019 05:21 PM
[Tutorial] Making a Simple Teleport Command [ZCMD] Luke_James Tutorials 5 24/04/2016 06:18 AM
[Tutorial] Making a very simple VIP system with /setvip command using dini+sscanf+ZCMD electrux Tutorials 2 25/07/2012 09:00 AM
Simple Teleport Command [For Beginners] legendario Help Archive 4 14/09/2009 09:30 PM


All times are GMT. The time now is 06:34 AM.


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