[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


Messages In This Thread
making advanced commands [zcmd] - by Chrisis - 18.07.2013, 21:58
Re: making advanced commands [zcmd] - by Rufio - 18.07.2013, 22:12
Re: making advanced commands [zcmd] - by DobbysGamertag - 18.07.2013, 22:17
Re : Re: making advanced commands [zcmd] - by Chrisis - 18.07.2013, 22:17
Re: making advanced commands [zcmd] - by gtakillerIV - 18.07.2013, 22:18
Re: making advanced commands [zcmd] - by AnonScripter - 25.10.2013, 21:21
Re: making advanced commands [zcmd] - by DarkLored - 25.10.2013, 22:19

Forum Jump:


Users browsing this thread: 2 Guest(s)