Sunday - 09. 08. 2026 •  Ucitavanje...
Link #1 Link #2 Link #3 Link #4 Link #5

!!

Registruj se i otključaj pun sadržaj

Kao gost imaš ograničen pristup forumu.
Registracijom dobijaš pristup svim temama, možeš pisati poruke, učestvovati u diskusijama i biti dio naše zajednice.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - surreal

Pages: [1] 2
1
Maps / Re: BRUTALNA MAPA BANKE! KO SKINE DOBIVA 1000E
« on: December 05, 2024, 01:06:53 PM »
vec vidjeno u neko modu ;) ;)

2
s obzirom kakve sve brutalne stvari radi, ovo ti je po meni onako. mid. Uglavnom, pohvale za trud naravno

3
Filterscipts | Includes | Plugins / Re: [FS] premium shop
« on: December 02, 2024, 08:07:58 PM »
You are not allowed to view links. Register or Login
Code: You are not allowed to view links. Register or Login
\shopTest.pwn(17) : warning 235: public function lacks forward declaration (symbol "LoadPlayerData")
\shopTest.pwn(23) : error 017: undefined symbol "INI_ReadInt"
\shopTest.pwn(29) : warning 235: public function lacks forward declaration (symbol "SavePlayerData")
\shopTest.pwn(35) : error 017: undefined symbol "INI_WriteInt"
\shopTest.pwn(103) : error 017: undefined symbol "COLOR_GREEN"
\shopTest.pwn(111) : warning 203: symbol is never used: "checkgold"
\shopTest.pwn(111) : warning 203: symbol is never used: "kupiitem"
\shopTest.pwn(111) : warning 203: symbol is never used: "premiumshop"

Ovo nije FS za pocetak :)

Code: You are not allowed to view links. Register or Login
new message[256];Da nije malo mnogo xD ?

Zar nije malo bolje staviti sve u dialog a ne slati 7 poruka u chat igracu?

Code: You are not allowed to view links. Register or Login
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to the Premium Shop!");
    for (new i = 0; i < MAX_PREMIUM_ITEMS; i++) {
        format(message, sizeof(message), "Item #%d: Cena: %d Gold", i + 1, g_PremiumItems[i][1]);
        SendClientMessage(playerid, COLOR_GREEN, message);
    }

    SendClientMessage(playerid, COLOR_YELLOW, "Koristi /kupiitem [item_id] da kupis item.");

Pritom kako ce da zna sta kupuje?

Code: You are not allowed to view links. Register or Login
if (strlen(params) == 0) {
        SendClientMessage(playerid, COLOR_RED, "Usage: /kupiitem [item_id]");
        return 1;
    }

    new itemID = strval(params);

    if (itemID < 1 || itemID > MAX_PREMIUM_ITEMS) {
        SendClientMessage(playerid, COLOR_RED, "Invalid item ID.");
        return 1;
    }

Malo je pametnije koristiti sscanf

Array ti nije tacno napisan :

Code: You are not allowed to view links. Register or Login
new g_PremiumItems[MAX_PREMIUM_ITEMS][5] = {
    {1, 50, 0},    // Item 1: Vehicle ID 1, Price: 50 Golda
    {2, 100, 1},   // Item 2: Weapon ID 2, Price: 100 Golda
    {3, 200, 0},   // Item 3: Vehicle ID 3, Price: 200 Golda
    {4, 150, 1},   // Item 4: Weapon ID 4, Price: 150 Golda
    {5, 300, 0}    // Item 5: Vehicle ID 5, Price: 300 Golda
};

Deklarisano 5, a imas 3 elementa

Takodje nema razloga da cuvas ID itema u nizu

Malo "cistija" verzija tvog koda :

Code: You are not allowed to view links. Register or Login
#define MAX_PREMIUM_ITEMS 5  // broj premium itema u shop

new g_PremiumItems[MAX_PREMIUM_ITEMS][2] = { //cuvamo 2 elementa ( ID vozila/oruzija i cenu koliko kosta )
    {511, 50}, 
    {24, 100}, 
    {522, 200},
    {31, 150}, 
    {518, 300} 
};

// komanda
CMD:premiumshop(playerid, params[])
{
    new message[32]; //nema potrebe vise

    SendClientMessage(playerid, COLOR_YELLOW, "Welcome to the Premium Shop!");
    for (new i = 0; i < MAX_PREMIUM_ITEMS; i++) {
        format(message, sizeof(message), "Item #%d: Cena: %d Gold", i+1, g_PremiumItems[i][1]); //prikazujemo ID i cenu
        SendClientMessage(playerid, COLOR_GREEN, message);
    }

    SendClientMessage(playerid, COLOR_YELLOW, "Koristi /kupiitem [item_id] da kupis item.");
    return 1;
}

// Komanda za kupovinu Premium Shop
CMD:kupiitem(playerid, params[])
{

    new itemID;
    if(sscanf(params, "d", itemID)) return SendClientMessage(playerid, COLOR_RED, "Usage: /kupiitem [item_id]");

    if (itemID < 1 || itemID > MAX_PREMIUM_ITEMS) return SendClientMessage(playerid, COLOR_RED, "Invalid item ID.");
    if (g_PlayerGold[playerid] < g_PremiumItems[itemID-1][1]) return SendClientMessage(playerid, COLOR_RED, "Nemas dovoljno golda da kupis ovaj item.");

    g_PlayerGold[playerid] -= g_PremiumItems[itemID-1][1];

    if(g_PremiumItems[itemID-1][0] > 46) { //ako je ID itema veci od 46 znaci da nije oruzije, posto je max ID oruzija 46 ( padobran )

        GivePlayerVehicle(playerid, g_PremiumItems[itemID-1][0]);
        SendClientMessage(playerid, COLOR_GREEN, "Uspesno ste kupili premium vozilo!");
    }
    else {
        GivePlayerWeapon(playerid, g_PremiumItems[itemID-1][0], 999);
        SendClientMessage(playerid, COLOR_GREEN, "Uspesno ste kupili premium oružje!");
    }

    SavePlayerData(playerid);

    return 1;
}

E sada opet kazem, dobro bi bilo da cuvas i naziv sta je u pitanju, i to bi izgledalo ovako :

Code: You are not allowed to view links. Register or Login
#define MAX_PREMIUM_ITEMS 5  // broj premium itema u shop

enum premiumItems { //deklarisemo koje informacije cuvamo

    itemName[32], //ime itema
    itemID, //ID
    itemPrice //Cena
};

new g_PremiumItems[MAX_PREMIUM_ITEMS][premiumItems] = { //sada cemo ovde popuniti array
    {"Infernus", 511, 50},  //stavljamo naziv itema, ID i cenu
    {"Deagle", 24, 100}, 
    {"NRG-500", 522, 200},
    {"M4", 31, 150}, 
    {"Buccaneer", 518, 300} 
};

// komanda
CMD:premiumshop(playerid, params[])
{
    new message[64];

    SendClientMessage(playerid, COLOR_YELLOW, "Welcome to the Premium Shop!");
    for (new i = 0; i < MAX_PREMIUM_ITEMS; i++) {
        format(message, sizeof(message), "Item %s(ID %d): Cena: %d Gold", g_PremiumItems[i][itemName], i-1, g_PremiumItems[i][itemPrice]); //prikazujemo naziv, id i cenu
        SendClientMessage(playerid, COLOR_GREEN, message);
    }

    SendClientMessage(playerid, COLOR_YELLOW, "Koristi /kupiitem [item_id] da kupis item.");
    return 1;
}

// Komanda za kupovinu Premium Shop
CMD:kupiitem(playerid, params[])
{

    new itemID;
    if(sscanf(params, "d", itemID)) return SendClientMessage(playerid, COLOR_RED, "Usage: /kupiitem [item_id]");

    if (itemID < 1 || itemID > MAX_PREMIUM_ITEMS) return SendClientMessage(playerid, COLOR_RED, "Invalid item ID.");
    if (g_PlayerGold[playerid] < g_PremiumItems[itemID-1][2]) return SendClientMessage(playerid, COLOR_RED, "Nemas dovoljno golda da kupis ovaj item.");

    g_PlayerGold[playerid] -= g_PremiumItems[itemID-1][2];

    if(g_PremiumItems[itemID-1][1] > 46) { //ako je ID itema veci od 46 znaci da nije oruzije, posto je max ID oruzija 46 ( padobran )

        GivePlayerVehicle(playerid, g_PremiumItems[itemID-1][1]);
    }
    else {
        GivePlayerWeapon(playerid, g_PremiumItems[itemID-1][0], 999);
    }

    va_SendClientMessage(playerid, -1, "Uspesno ste kupili %s za %d golda!", g_PremiumItems[itemID-1][itemName], g_PremiumItems[itemID-1][itemPrice]);

    SavePlayerData(playerid);

    return 1;
}
ma vidi se da je s nekog foruma pokupio ovo

4
TextDraws / Re: TextDraw "Balkan Bet"
« on: December 02, 2024, 07:10:29 PM »
Uh lijepo. Pohvalee

5
Gamemode Skripte / Re: Zara Gaming
« on: November 30, 2024, 08:28:54 PM »
smece

6
Filterscipts | Includes | Plugins / Re: [FS] Object Attacher
« on: November 30, 2024, 03:12:23 PM »
not bad

7
OFFTOPIC / Re: #1 -> Glavni Razgovor
« on: November 29, 2024, 02:34:02 PM »
puno losih ocena

8
Gamemode Skripte / Re: [ IG ] Ideal Gaming by Tebrex
« on: November 27, 2024, 11:32:19 PM »
brisi ovo brze bolje, pokajat ces se kasnije

9
OFFTOPIC / Re: #1 -> Glavni Razgovor
« on: November 27, 2024, 02:15:10 PM »
pitao sam u svitanje dana, gdje je adriana gdje je adriana

10
OFFTOPIC / Re: #1 -> Glavni Razgovor
« on: November 26, 2024, 08:07:32 PM »
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login
selam, sta ima

Sve po starom, moja rano :'(
Sve po starom, dan za danom
Deo duše odlomiš tu i tamo

11
OFFTOPIC / Re: #1 -> Glavni Razgovor
« on: November 26, 2024, 01:36:06 PM »
selam, sta ima

12
Gamemode Skripte / Re: Mexico Gaming
« on: November 25, 2024, 04:03:46 PM »
mid

13
Gamemode Skripte / Re: Balkan Premium
« on: November 25, 2024, 03:06:38 PM »
onako

14
Gamemode Skripte / Re: Balkan Night
« on: November 25, 2024, 03:06:30 PM »
lijepo

15
Gamemode Skripte / Re: Miami House
« on: November 25, 2024, 03:06:21 PM »
its okey

Pages: [1] 2

Vrati se na pocetak
SMF 2.0.19 | SMF © 2021, Simple Machines
Page created in 0.047 seconds with 16 queries.
ZBS © 2011 - 2024, Zapadni Balkan SA:MP
Weiss X 10.2 © 2014, Jade Works Studio
Footer background belongs to GTA Forums
SimplePortal 2.3.7 © 2008-2026, SimplePortal