06.07.2010, 00:14
(
Последний раз редактировалось YmOn; 06.07.2010 в 09:09.
)
What It?
It Easy cmd system, Vety usefull for filterscrits where you cant use strtok function
How To Use It?
Very Easy!
Examples:
Command /me [text]
Command /ban [playerid] [reason]
Command /pm | msg [playerid] [text]
cmd Speed
Sory But Speed is not Fantastic...
Where Get This Macroses?
Here!
You Have Any Examle Script?
Yeh!
There Pastebin Click
Comment Please!!!
Sory For bad english
It Easy cmd system, Vety usefull for filterscrits where you cant use strtok function
How To Use It?
Very Easy!
Examples:
Command /me [text]
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new params[128]; ycmd("/me") { if(!strlen(params))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /me [text]"); new string[256]; format(string,sizeof(string),"** %s [ID: %d] %s",PlayerName(playerid),playerid,params); SendClientMessageToAll(COLOR_MAIN,string); return true; } return false; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new params[128]; ycmd("/ban") { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOR_MAIN,"You Not Admin"); if(!strlen(params))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /ban [playerid] [reason]"); new idx, BannedID = strval(strtok(params,idx)),MessString[256],ReasonString[64]; if(!strlen(params[idx]))ReasonString = "N/A";else format(ReasonString,sizeof(ReasonString),"%s",params[idx]); format(MessString,sizeof(MessString),"Admin %s [ID:%d] Ban %s [ID:%d] [Reason: %s]",PlayerName(playerid),playerid,PlayerName(BannedID),BannedID,ReasonString); SendClientMessageToAll(COLOR_MAIN,MessString); BanEx(BannedID,MessString); return true; } return false; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new params[128]; ycmd("/pm") { new idx, tmp[256], id, string[256]; tmp = strtok(params,idx); if(!strlen(tmp))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /pm | msg [playerid] [text]"); id = strval(tmp); tmp = strtok(params,idx); if(!strlen(tmp))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /pm | msg [playerid] [text]"); format(string,sizeof(string),"* PM From %s [ID: %d] To %s [ID: %d]",PlayerName(playerid),playerid,PlayerName(id),id,tmp); SendClientMessage(playerid,COLOR_MAIN,string); SendClientMessage(id,COLOR_MAIN,string); return true; } ycmd("/msg")return ycmd_red("/pm"); return false; }
Sory But Speed is not Fantastic...
Where Get This Macroses?
Here!
Код:
#define ycmd(%1) if(!strcmp(cmdtext,%1,true,strlen(%1))&&((!strlen(cmdtext[strlen(%1)])&&format(params,sizeof(params),""))||(cmdtext[strlen(%1)]==' '&&format(params,sizeof(params),"%s",cmdtext[strlen(%1)+1])))) #define ycmd_red(%1) format(params,sizeof(params),""%1" %s",params),CallLocalFunction("OnPlayerCommandText","ds",playerid,params)
Yeh!
There Pastebin Click
Comment Please!!!
Sory For bad english