Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _ ____ _
- (_)/ ___|_ __ ___ __| |
- | | | | '_ ` _ \ / _` |
- | | |___| | | | | | (_| |
- |_|\____|_| |_| |_|\__,_|
- Criado por Bruno da Silva ( brunoemail@r7.com ) (Thanks SlashPT)
- www.ips-team.blogspot.com
- */
- #define cmd(%1,%2,%3) @%1(%2,%3); public @%1(%2,%3)
- //============== [ Processar o Comando ] =====================
- new
- cmdname[32],
- cmdindex
- ;
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- return CallLocalFunction("OnReceivedCommand", "isi", playerid, cmdtext, ((cmdindex = strfind ((cmdtext[0] = 0x40, cmdtext), "\x20")), (cmdindex == -1) ? CallLocalFunction(cmdtext, "is", playerid, "\1") : (strmid(cmdname, cmdtext, 0, cmdindex), CallLocalFunction (cmdname, "is", playerid, !cmdtext[cmdindex + 1] ? '\1' : cmdtext[cmdindex + 1]))));
- }
- //================ [ Gerenciar Comandos ] ======================
- forward OnReceivedCommand(playerid, cmdtext[], bool:sucess);
- public OnReceivedCommand(playerid, cmdtext[], bool:sucess)
- {
- if(!sucess)
- {
- SendClientMessage(playerid, 0xFFFFFFF, "[Erro] O comando digitado não existe");
- }
- return true;
- }
- //================ [ Exemplo de Comando ] ======================
- cmd(me, playerid, params[])
- {
- if(strlen(params) < 5) return SendClientMessage(playerid, 0xFFFFFFFF, "[Erro] Por favor utilize algum texto (/me [texto]) (mínimo 5 caracteres)");
- static string[128];
- GetPlayerName(playerid, string, MAX_PLAYER_NAME);
- format(string, 128, "O Jogador %s(%d) acaba de falar %s (use /me [texto])", string, playerid, params);
- return SendClientMessageToAll(0xFFFFFFFF, string), true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement