Advertisement
Guest User

Convertendo zcmd para strcmp;

a guest
Dec 4th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.77 KB | None | 0 0
  1. /*******************************************************************************
  2. Script Name: Sistema de Som Automotivo
  3. Script Version: 0.1a
  4. Script Dev: Matheus Vieira (Cidiei)
  5.  
  6. WhoPawn Copyright 2014
  7. *******************************************************************************/
  8. #define FILTERSCRIPT
  9. /******************************************************************************/
  10. #include <a_samp>
  11. /******************************************************************************/
  12. #if defined FILTERSCRIPT
  13. /******************************************************************************/
  14. public OnFilterScriptInit(){
  15.         print("Sistema carregado...");
  16.         return 1;
  17. }
  18. /******************************************************************************/
  19. public OnFilterScriptExit(){
  20.         return 1;
  21. }
  22. /******************************************************************************/
  23. public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
  24. {
  25.     switch(dialogid)
  26.     {
  27.             case 11:{
  28.                 if(response)
  29.                 {
  30.                     if(!strlen(inputtext))
  31.                     {
  32.                         SendClientMessage(playerid,-1,"Nenhum url foi digitado na input!");
  33.                         return 0;
  34.                     }
  35.                     new Float:Pos[3];
  36.                     GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  37.                     for(new i = 0; i <MAX_PLAYERS; i++)
  38.                     {
  39.                         if(IsPlayerInRangeOfPoint(i,10.0,Pos[0],Pos[1],Pos[2]))
  40.                         {
  41.                                     PlayAudioStreamForPlayer(i,inputtext);
  42.                         }
  43.                     }
  44.                 }
  45.                 else return 0;
  46.             }
  47.     }
  48.     return 1;
  49. }
  50. /******************************************************************************/
  51. public OnPlayerCommandText(playerid, cmdtext[])
  52. {
  53.     /*Área de Comandos*/
  54.     if(strcmp(cmdtext,"/tocarsom", true)==0)
  55.     {
  56.         if(!IsPlayerInAnyVehicle(playerid))
  57.             return SendClientMessage(playerid,-1,"Você não está em um veículo!");
  58.         ShowPlayerDialog(playerid,11,DIALOG_STYLE_INPUT,"Radio","Cole aqui o endereço do audio.","Tocar","Cancelar");
  59.         return 1;
  60.     }
  61.     /*Parar Audio*/
  62.     if(strcmp(cmdtext,"/pararaudio", true)==0)
  63.     {
  64.         new Float:Pos[3];
  65.         GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  66.         for(new i = 0; i <MAX_PLAYERS; i++)
  67.         {
  68.                 if(IsPlayerInRangeOfPoint(i,10.0,Pos[0],Pos[1],Pos[2]))
  69.                 {
  70.                     StopAudioStreamForPlayer(playerid);
  71.                 }
  72.         }
  73.         return 1;
  74.     }
  75.     return 1;
  76. }
  77. /******************************************************************************/
  78. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement