toribio

toribio

Nov 6th, 2008
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1.     if(!strcmp(cmd, "/mostrararmas", true))
  2.     {
  3.         new temp[0x100], plid;
  4.         temp = strtok(cmdtext, idx);
  5.         plid = strval(temp);
  6.         if(!strlen(temp))return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /mostrararmas [playerid]");
  7.         if(IsPlayerConnected(plid))
  8.         {
  9.             new weapon[0xC], ammo[0xC], armas1[0x100], armas2[0x100], weapcount;
  10.             for(new i; i < 0xC; i++)
  11.             {
  12.                 GetPlayerWeaponData(plid, i+1, weapon[i], ammo[i]);
  13.                 if(weapon[i] > 0 && weapon[i] < 47)
  14.                 {
  15.                     new tmp[0x50];
  16.                     GetWeaponName(weapon[i], tmp, sizeof tmp);
  17.                     format(tmp, sizeof tmp, "%s(%d) ", tmp, ammo[i]);
  18.                     if(weapcount < 6){
  19.                         strcat(armas1, tmp);
  20.                     }else{
  21.                         strcat(armas2, tmp);}
  22.                     weapcount++;
  23.                 }
  24.             }
  25.             if(!weapcount)return SendClientMessage(playerid, 0xFFFFFFAA, "Este jogador nīŋŊo possui armas.");
  26.             new tmp[0x50];
  27.             GetPlayerName(plid, tmp, sizeof tmp);
  28.             format(tmp, sizeof tmp, "Armas de %s:", tmp);
  29.             SendClientMessage(playerid, 0xFFF000AA, tmp);
  30.             SendClientMessage(playerid, 0xFFFFFFAA, armas1);
  31.             if(weapcount >= 6)SendClientMessage(playerid, 0xFFFFFFAA, armas2);
  32.             GetWeaponName(GetPlayerWeapon(plid), tmp, sizeof tmp);
  33.             format(tmp, sizeof tmp, "Arma atual: %s.", (!strlen(tmp) ? ("nenhuma") : (tmp)));
  34.             SendClientMessage(playerid, 0xFFFFFFAA, tmp);
  35.         } else {
  36.             SendClientMessage(playerid, 0xFF0000AA, "Jogador nīŋŊo conectado!");
  37.         }
  38.         return 1;
  39.     }
Add Comment
Please, Sign In to add comment