Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(dialogid == 96)
- {
- if(!response)
- {
- if(player_Dialog[playerid]==0) return 1;
- else
- {
- player_Dialog[playerid]=0;
- 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");
- return 1;
- }
- }
- if(player_Dialog[playerid] == 0)
- {
- player_Dialog[playerid] = 2;
- ShowPlayerDialog(playerid,96,DIALOG_STYLE_INPUT,"» Admin « Prix d'achat du bizz","Entrez le prix d'achat du bizz :","Continuer","Retour");
- }
- else if(player_Dialog[playerid] == 2)
- {
- if(!strlen(inputtext) || strval(inputtext)>10000000 || strval(inputtext)<1)
- {
- msg_Client(playerid, COLOR_WHITE, "» Admin « Le prix doit être entre 1 et 10000000.");
- return ShowPlayerDialog(playerid,96,DIALOG_STYLE_INPUT,"» Admin « Prix d'achat du bizz","Entrez le prix d'achat du bizz, svp :","Continuer","Retour");
- }
- new ID=-1;
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- for(new bi = 0; bi < totalBizz; bi++)
- {
- if(bizz[bi][used] == 0)
- {ID = bi;break;}
- }
- if(ID==-1)
- {
- format(sql, sizeof(sql), "SELECT * FROM lvrp_server_bizz");
- mysql_query(MYSQL,sql);
- cache_get_row_count(ID);
- if(ID>MAX_BIZZ)
- {msg_Client(playerid,COLOR_WHITE,"{FF2727}» Admin «{FFABAD} Maximum de bizz atteint."); return 1;}
- 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);
- mysql_pquery(MYSQL,sql);
- totalBizz++;
- // bizz_UpdateInfos(ID);
- }
- bizz[ID][pos][0] = X;
- bizz[ID][pos][1] = Y;
- bizz[ID][pos][2] = Z;
- bizz[ID][pos][3] = 0;
- bizz[ID][pos][4] = 0;
- bizz[ID][pos][5] = 0;
- strmid(bizz[ID][owner], "Personne", 0, strlen("Personne"), 32);
- bizz[ID][owned] = 0;
- strmid(bizz[ID][description], "A Vendre", 0, strlen("A Vendre"), 64);
- bizz[ID][fund] = 0;
- bizz[ID][enterCost] = 0;
- bizz[ID][price] = strval(inputtext);
- bizz[ID][prodCost] = 2;
- bizz[ID][lock] = 1;
- bizz[ID][variable] = 0;
- bizz[ID][typeZ] = 0;
- bizz[ID][interior] = 0;
- bizz[ID][products] = 0;
- bizz[ID][prodMax] = 2000;
- bizz[ID][world] = ID;
- bizz[ID][used] = 1;
- bizz_Save(ID);
- bizz_UpdateInfos(ID);
- player_Dialog[playerid] = 0;
- format(string,sizeof(string),"{FF2727}» Admin «{FFABAD} Bizz id %d créé.",ID);
- msg_Client(playerid,COLOR_WHITE,string);
- return 1;
- }
- }
Add Comment
Please, Sign In to add comment