28.04.2012, 10:47
plz help me in scripting i also saw that scripting tutorials and etc.. can someone teach me
public OnPlayerCommandText(playerid, cmdtext[])
{
new vehicleid;
dcmd(heal ,4, cmdtext);
return 0;
}
dcmd_heal(playerid, params[])
{
#pragma unused params
SetPlayerHealth(playerid,100.0);
return 1;
}
can u tell how to use it like
pawn Код:
|
dcmd(heal,4,cmdtext)
here heal is the command 4 is the length of Digits i.e. command length if u do a command like ban its length will be 3 add that part in OnPlayerCommandText now. // here dcmd_heal is the function for command player id = player how use command , params are optional parametes which are used in commands like /ban pPlayerID it will ban another Player i.e. pPlayerID entered in command dcmd_heal(playerid , params[]) { // command code goes here } |