18.07.2013, 21:58
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 )
/reclass ( take you back to the class selection when you respawn OR die )
/smoke ( put a cigarette in your hand )
/cj ( takes you to cj's house )
/sit ( anim - no need to explain )
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
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;
}
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;
}
pawn Код:
CMD:smoke(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
SendClientMessage(playerid,changeme,"you now have a cigarette in your hand !");
return 1;
}
pawn Код:
CMD:cj(playerid, params[])
{
SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187);
SetPlayerInterior(playerid,3);
return 1;
}
pawn Код:
CMD:sit(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SITTING);
return 1;
}
another note : don't -rep me for my bad english ! because i'm arabian