Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined _dcmd_included
- #endinput
- #endif
- #define _dcmd_included
- #define COMMAND:%1(%2) \
- forward dcmd_%1(%2); \
- public dcmd_%1(%2)
- #define CMD:%1(%2) \
- COMMAND:%1(%2)
- #define command(%1,%2,%3) \
- COMMAND:%1(%2, %3)
- #define cmd(%1,%2,%3) \
- COMMAND:%1(%2, %3)
- #if !defined isnull
- #define isnull(%1) \
- ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- static __c, __command[32] = "dcmd_";
- forward OnPlayerCommandPerfomed(playerid, sucess);
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- __command = "dcmd_",
- __c = 0;
- while(cmdtext[++__c] > 0x20)
- if(0x41 <= cmdtext[__c] <= 0x5A)
- cmdtext[__c] = tolower(cmdtext[__c]);
- strcat(__command, cmdtext, __c+6);
- strdel(__command, 4, 5);
- if(!cmdtext[__c])
- return CallLocalFunction("OnPlayerCommandPerfomed", "ii", playerid, CallLocalFunction(__command, "is", playerid, "\1")), true;
- return CallLocalFunction("OnPlayerCommandPerfomed", "ii", playerid, CallLocalFunction(__command, "is", playerid, cmdtext[__c+1])), true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement