Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < a_samp >
- #if defined _Included_Scmd
- #endinput
- #else
- #define _Included_Scmd
- #endif
- #define SCMD:%0(%1) \
- forward cmd_%0(%1); \
- public cmd_%0(%1)
- #define CMD:%0(%1) SCMD:%0(%1)
- #define COMMAND:%0(%1) SCMD:%0(%1)
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new pos, funcname[(32)];
- while(cmdtext[++pos] > ' ')
- {
- funcname[pos-1] = tolower(cmdtext[pos]);
- }
- format(funcname, sizeof funcname, "cmd_%s",funcname);
- while(cmdtext[pos] == ' ') pos++;
- if(!cmdtext[pos])
- {
- return CallLocalFunction(funcname, "i", playerid);
- }
- return CallLocalFunction(funcname, "i", playerid);
- }
- //Exmaple command:
- SCMD:test(playerid)
- {
- GivePlayerMoney(playerid, 25000);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment