/me [szöveg] [/quote]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;}2. Példa: /ban [iD/Név] [indok] [/quote]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;} 3. Példa: /pm [iD/Név] [üzenet] [/quote]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;} Mi a YCMD makrója?#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) A script készítoje : YmOn.
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;}
/ban [iD/Név] [indok] [/quote]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;} 3. Példa: /pm [iD/Név] [üzenet] [/quote]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;} Mi a YCMD makrója?#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) A script készítoje : YmOn.
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;}
/pm [iD/Név] [üzenet] [/quote]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;} Mi a YCMD makrója?#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) A script készítoje : YmOn.
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;}
#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)
ycmd(\"CMD\")
Hát nem a kezelésrol van szó hanem hogy mennyire gyors. felolem lehet akármi benne ha nem gyors vagy jó.
Hát nem a kezelésrol van szó hanem hogy mennyire gyors. felolem lehet akármi benne ha nem gyors vagy jó. ez jóval gyorsabb mint a dcmd, és a zcmd [/quote]Szerintem inkább ez is egyesével összehasonlítja a szövegeket Nekem meg a kezelhetoség számít ZCMD + sscanf az a legáttekinthetobb.Amúgy én úgy használom, h a params-os parancsok mennek ZCMD-be, az egyszeruek meg rendesen CommandText-alá. [/quote]Ennek se sok értelme O_o CMD:parans(playerid){return 1;}
Nekem meg a kezelhetoség számít ZCMD + sscanf az a legáttekinthetobb.Amúgy én úgy használom, h a params-os parancsok mennek ZCMD-be, az egyszeruek meg rendesen CommandText-alá. [/quote]Ennek se sok értelme O_o CMD:parans(playerid){return 1;}
CMD:parans(playerid){return 1;}
http://forum.sa-mp.com/showpost.php?p=748447&postcount=27Ez a leglassabb, használjátok a zcmd-t, eddig az a legjobb( ez valószínuleg így is marad ).E: A témát áthelyezem.