Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ** Autor: ShukaZ
- ** Datum: 06.Mai.2010
- */
- #include <a_samp>
- forward scmdOnPlayerCommandText(playerid,cmdtext[]);
- #define scmd:%1(%2) \
- forward scmd_%1(%2); \
- public scmd_%1(%2)
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new fnd = strfind(cmdtext," ");
- new param[255],cmdstr[48];
- if(fnd!=-1)
- {
- if(strlen(cmdtext[fnd+1]) > 0)
- {
- strmid(param,cmdtext,(fnd+1),strlen(cmdtext));
- cmdtext[fnd] = '\0';
- format(cmdstr,sizeof cmdstr,"scmd_%s",cmdtext[1]);
- printf(cmdtext[1]);
- if(funcidx(cmdstr)!=-1)return CallRemoteFunction(cmdstr,"is",playerid,param);
- }
- }
- else
- {
- format(cmdstr,sizeof cmdstr,"scmd_%s",cmdtext[1]);
- printf(cmdtext[1]);
- if(funcidx(cmdstr)!=-1)return CallRemoteFunction(cmdstr,"i",playerid);
- }
- return 0;
- }
- scmd:test(playerid,params[])
- {
- SendClientMessage(playerid,0xFF0000FF,params);
- return 1;
- }
- #define OnPlayerCommandText scmdOnPlayerCommandText
Advertisement
Add Comment
Please, Sign In to add comment