Jump to content

Kox

Members
  • Posts

    4
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

346 profile views

Kox's Achievements

Noob

Noob (1/14)

0

Reputation

  1. Up
  2. Buna ziua am gamemode Bladex si intampin o problema , lam avut si in trecut si sa rezolvat simplu dar au trecut 3-4 ani si nu le mai am asa bine. Deci un player sa ii spun X merge si isi pune masina de vanzare la dealership un fel de targ auto , Playerul Y merge si cumpara masina , Playerul X nu primeste bani. As dori daca ma puteti ajuta sa fac sa primeasca bani! Va multumesc if(dialogid == DIALOG_TARGAUTO2) { if(!response) return 1; new string[256]; new index; format(string, sizeof(string),"SELECT * FROM targauto Where Model = %d and Vanzator = '%s' And id = %d", ModelTarg[playerid], NumeTarg[playerid], IdTarg[playerid]); new Cache: Result = mysql_query( mysql, string), Get[ 2 ]; cache_get_data( Get[ 0 ], Get[ 1 ], SQL ); // Get[ 0 ] - Rows || Get[ 1 ] - Fields || SQL - connectionHandle for(new i = 0; i < Get[0]; i++) { index ++; new pret,model,vanzator[50],color1,color2, Float: km; pret = cache_get_field_content_int( 0, "Pret", mysql ); model = cache_get_field_content_int( 0, "Model", mysql ); color1 = cache_get_field_content_int( 0, "Color1", mysql ); color2 = cache_get_field_content_int( 0, "Color2", mysql ); km = cache_get_field_content_float( 0, "KM", mysql ); cache_get_field_content( 0, "Vanzator", vanzator, mysql, MAX_PLAYER_NAME ); if(GetMoney(playerid) < pret) return GameTextForPlayer(playerid, "~R~NO CASH!", 4000 ,3); if(PlayerInfo[playerid][pVehicle1] != 0 && PlayerInfo[playerid][pVehicle2] != 0 && PlayerInfo[playerid][pVehicle3] != 0) { SendClientMessage(playerid, COLOR_GREY, "You cannot purchase any more vehicles as all 3 of your slots are full."); return 1; } if(PlayerInfo[playerid][pVehicle1] != 1) { TakeMoney(playerid,pret); if(strcmp(GetName(playerid),vanzator, false) == 0) { if(!IsPlayerOnline(vanzator)) { format(string,sizeof(string), "UPDATE players SET `Money` = Money + %d WHERE 'Name' = '%s' AND `IsConnected` = 0", pret,vanzator); mysql_tquery(mysql, string, "", ""); new stringquery[256]; new notificare[200]; format(notificare,200, "%s ti-a cumparat %s pus la targ.\nAi primit pentru vanzarea acestuia: %s$", GetName(playerid), VehicleNames[model - 400], FormatMoney(pret)); format(stringquery,sizeof(stringquery), "INSERT INTO `notifications` (`name`, `continut`) VALUES ('%s', '%s')", vanzator, notificare); mysql_tquery(mysql, stringquery, "Notification", ""); } else { foreach(new ig : Player) { if(strcmp(GetName(ig),vanzator, true) == 0) { GiveMoney(ig, pret); new stringbanuti[100]; format(stringbanuti, 100, "%s ti-a cumparatat %s din targ. Ai primit: %s$", GetName(playerid), VehicleNames[model - 400], FormatMoney(pret)); SCM(ig, COLOR_GRAD2, stringbanuti); } } } }
  3. Incerc revin cu un raspuns
  4. Buna ziua ma scuzati ca va deranjez cu asta banuiesc ca e minor dar nu stiu sincer si vreau sa invat. Nume:Kox Varsta:22 Problema:Am un event Hallowen Event totul ok pana iau bani dupa ce gasesc obiectul dar cand ies si intru iarasi nu se salveaza bani. Tin sa precizez ca gamemode ruleaza pe Mysql cu baza de date. Imagini:Nu Cod sursa: public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == Pumpkin) { DestroyPickup(Pumpkin); new string[256], randmoney = 50000 + random(10000), name[MAX_PLAYER_NAME], Hour, Minute, Second; Winner = 1; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "> Pumpkin was found by %s. His wish him congratulations!", name); SendClientMessageToAll(COLOR_MAUVE, string); gettime(Hour, Minute, Second); format(string, sizeof(string), "> A new pumpkin will be hidden in %d minutes.", Minutes-Minute+10); SendClientMessageToAll(COLOR_MAUVE, string); format(string, sizeof(string), "You won the sum of $%d", randmoney); SendClientMessage(playerid, 0x2C8522FF, string); GivePlayerMoney(playerid, randmoney); Va multumesc
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

moduri samp