Advertisement
DraKiNs

[COD] Return Param Comandos

Jun 27th, 2011
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.82 KB | None | 0 0
  1. /*
  2.   @Creator: DraKiNs
  3.   @Project: ReturnParam
  4.  
  5.   @Date: 27/06/2011
  6.   @Site: www.ips-team.blogspot.com
  7. */
  8.  
  9. //===========  [ Command ] =======================================
  10.  
  11. if(!strcmp(cmdtext, "/me", true, 3)) // 3 = lenght of /me
  12. {
  13.     static
  14.         sStr[128]
  15.     ;
  16.     GetPlayerName(playerid, sStr, MAX_PLAYER_NAME);
  17.     format(sStr, 128, "%s[%i]: %s",sStr, playerid, ReturnParam(cmdtext, 1));
  18.     return SendClientMessageToAll(0xFFFFFFFF, sStr);
  19. }
  20.  
  21. //===========  [ Function ] =======================================
  22.  
  23. ReturnParam(cmdtext[], param)
  24. {
  25.     #if !defined MAX_STRING
  26.         #define MAX_STRING 128
  27.     #endif
  28.  
  29.     new
  30.         i,
  31.         spaces,
  32.         string[MAX_STRING],
  33.     ;
  34.     for( ; spaces != param; ++i)
  35.     {
  36.         if(!(cmdtext[i] == 0x20)) continue;
  37.         spaces++;
  38.     }
  39.     return strcat(string,cmdtext[i], MAX_STRING), cmdtext[i] = EOS, string;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement