[Tutorial] making advanced commands [zcmd]
#1

i sot alot of tutos that teach how to make simple commands , so i decided to make a tuto about advanced ones

let's start :

/buyhealth ( not /heal for free )

pawn Код:
CMD:buyhealth(playerid, params[])
{
    if(GetPlayerMoney(playerid) => 500) // if the player have 500+ in his pocket
    {
        SetPlayerHealth(playerid,100); // we heal him a.k.a give him full health
        SendClientMessage(playerid,changeme,"You paid 500$ to heal your self !"): // changeme : the color you wan't , green for example
    }else SendClientMessage(playerid,changeme,"You don't have 500$ !"); // if the player don't have 500$ we give him an error message says that he can't pay
    return 1;
}
/reclass ( take you back to the class selection when you respawn OR die )

pawn Код:
CMD:reclass(playerid, params[])
{
    ForceClassSelection(playerid); /* this is the important thing , the code that force the player to rechoose his class / team ( if you have TDM )
    SendClientMessage(playerid,changeme,"Returning to class selection after next death !");  // changeme : the color you wan't , yellow for example
    return 1;
}
/smoke ( put a cigarette in your hand )

pawn Код:
CMD:smoke(playerid, params[])
{
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
    SendClientMessage(playerid,changeme,"you now have a cigarette in your hand !");
    return 1;
}
/cj ( takes you to cj's house )

pawn Код:
CMD:cj(playerid, params[])
{
    SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187);
    SetPlayerInterior(playerid,3);
    return 1;
}
/sit ( anim - no need to explain )

pawn Код:
CMD:sit(playerid, params[])
{
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SITTING);
    return 1;
}
note :if i fergot a type of commands please reply on this thread

another note : don't -rep me for my bad english ! because i'm arabian
Reply
#2

Not bad. But it would be better to tell zcmd's method though.

Additional note:

Zcmd doesnt get written to OnPlayerCommandText. You can write it at the end of your script below the last }.

And you will need this at the top of your script

pawn Код:
#include <zcmd>
I think you should have explained better. But still, not bad.

Edit: You should edit cj's command you wrote smoke instead of cj
Reply
#3

Ok, this is partially nice. The only thing that lets you do is your buyhealth command, will take $500 even if their health is at 100.
Reply
#4

Quote:
Originally Posted by Rufio
Посмотреть сообщение
Not bad. But it would be better to tell zcmd's method though.

Additional note:

Zcmd doesnt get written to OnPlayerCommandText. You can write it at the end of your script below the last }.

And you will need this at the top of your script

pawn Код:
#include <zcmd>
I think you should have explained better. But still, not bad.

Edit: You should edit cj's command you wrote smoke instead of cj
ops i haven't notice that , btw thanks i will edit it
Reply
#5

I don't see anything advanced really.
Reply
#6

anyone can script these commands, it's not advanced.
Reply
#7

This isnt that advenced it looks very simple but good job
+1REPED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)