Guest User

Untitled

a guest
Aug 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.74 KB | None | 0 0
  1.     if(dialogid == 96)
  2.     {
  3.         if(!response)
  4.         {
  5.             if(player_Dialog[playerid]==0) return 1;
  6.             else
  7.             {
  8.                 player_Dialog[playerid]=0;
  9.                 ShowPlayerDialog(playerid,96,DIALOG_STYLE_MSGBOX,"» Admin « Création d'un bizz","Vous êtes sur le point de creer un bizz, l'entrée du bizz se situra à votre position actuelle.\nVous pourrez toujours le supprimer ou modifier apres (/bizz sup(rimer) - /bizz edit)","Continuer","Annuler");
  10.                 return 1;
  11.             }
  12.         }
  13.         if(player_Dialog[playerid] == 0)
  14.         {
  15.             player_Dialog[playerid] = 2;
  16.             ShowPlayerDialog(playerid,96,DIALOG_STYLE_INPUT,"» Admin « Prix d'achat du bizz","Entrez le prix d'achat du bizz :","Continuer","Retour");
  17.         }
  18.         else if(player_Dialog[playerid] == 2)
  19.         {
  20.             if(!strlen(inputtext) || strval(inputtext)>10000000 || strval(inputtext)<1)
  21.             {
  22.                 msg_Client(playerid, COLOR_WHITE, "» Admin « Le prix doit être entre 1 et 10000000.");
  23.                 return ShowPlayerDialog(playerid,96,DIALOG_STYLE_INPUT,"» Admin « Prix d'achat du bizz","Entrez le prix d'achat du bizz, svp :","Continuer","Retour");
  24.             }
  25.             new ID=-1;
  26.             new Float:X,Float:Y,Float:Z;
  27.             GetPlayerPos(playerid, X, Y, Z);
  28.             for(new bi = 0; bi < totalBizz; bi++)
  29.             {
  30.                 if(bizz[bi][used] == 0)
  31.                     {ID = bi;break;}
  32.             }
  33.             if(ID==-1)
  34.             {
  35.                 format(sql, sizeof(sql), "SELECT * FROM lvrp_server_bizz");
  36.                 mysql_query(MYSQL,sql);
  37.                 cache_get_row_count(ID);
  38.                 if(ID>MAX_BIZZ)
  39.                     {msg_Client(playerid,COLOR_WHITE,"{FF2727}» Admin «{FFABAD} Maximum de bizz atteint."); return 1;}
  40.  
  41.                 format(sql, sizeof(sql), "INSERT INTO lvrp_server_bizz SET id=%d, Created=1, Varia=0, Pos_x=%f, Pos_y=%f, Pos_z=%f, Message='A Vendre', Price=%d, Type=0, Interior=0, WV=%d",ID+1, X, Y, Z, strval(inputtext), ID-1);
  42.                 mysql_pquery(MYSQL,sql);
  43.                 totalBizz++;
  44.             // bizz_UpdateInfos(ID);
  45.             }
  46.            
  47.             bizz[ID][pos][0] = X;
  48.             bizz[ID][pos][1] = Y;
  49.             bizz[ID][pos][2] = Z;
  50.             bizz[ID][pos][3] = 0;
  51.             bizz[ID][pos][4] = 0;
  52.             bizz[ID][pos][5] = 0;
  53.             strmid(bizz[ID][owner], "Personne", 0, strlen("Personne"), 32);
  54.             bizz[ID][owned] = 0;
  55.             strmid(bizz[ID][description], "A Vendre", 0, strlen("A Vendre"), 64);
  56.             bizz[ID][fund] = 0;
  57.             bizz[ID][enterCost] = 0;
  58.             bizz[ID][price] = strval(inputtext);
  59.             bizz[ID][prodCost] = 2;
  60.             bizz[ID][lock] = 1;
  61.             bizz[ID][variable] = 0;
  62.             bizz[ID][typeZ] = 0;
  63.             bizz[ID][interior] = 0;
  64.             bizz[ID][products] = 0;
  65.             bizz[ID][prodMax] = 2000;
  66.             bizz[ID][world] = ID;
  67.             bizz[ID][used] = 1;
  68.             bizz_Save(ID);
  69.             bizz_UpdateInfos(ID);
  70.             player_Dialog[playerid] = 0;
  71.             format(string,sizeof(string),"{FF2727}» Admin «{FFABAD} Bizz id %d créé.",ID);
  72.             msg_Client(playerid,COLOR_WHITE,string);
  73.             return 1;
  74.         }
  75.     }
Add Comment
Please, Sign In to add comment