making advanced commands [zcmd] -
Chrisis - 18.07.2013
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
Re: making advanced commands [zcmd] -
Rufio - 18.07.2013
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
I think you should have explained better. But still, not bad.
Edit: You should edit cj's command you wrote smoke instead of cj
Re: making advanced commands [zcmd] -
DobbysGamertag - 18.07.2013
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.
Re : Re: making advanced commands [zcmd] -
Chrisis - 18.07.2013
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
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
Re: making advanced commands [zcmd] -
gtakillerIV - 18.07.2013
I don't see anything advanced really.
Re: making advanced commands [zcmd] -
AnonScripter - 25.10.2013
anyone can script these commands, it's not advanced.
Re: making advanced commands [zcmd] -
DarkLored - 25.10.2013
This isnt that advenced it looks very simple but good job
+1REPED