[POMOC]Komanda

Započeo Aldin Begovic
2. Apr. 2012. Zaključano
532
pregleda
6
postova
Aldin Begovic
4
Made Man
2. Apr. 2012.
mod:moj gm
opis problema: Kada kucam /kupifirmu kaze da vec posjedujem firmu ! Greska je u pvaru ali neznam kako da postavim
COMMAND:kupifirmu(playerid, params[])
{
#pragma unused params
new string[ 128 ], stringt;
new bouse = GetPVarInt(playerid, "Firma");
if( bouse != 255 || GetPVarInt(playerid, "Firma") != 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}
if( bouse == 255 || GetPVarInt(playerid, "Firma") == 255)
Johnâ„¢
5
Godfather
3. Apr. 2012.
Ovaj dio koda:

if( bouse != 255 || GetPVarInt(playerid, "Firma") != 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}


Bi trebao izgledati ovako (po tvom sadašnjem kodu):

if(GetPVarInt(playerid, "Firma") == 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}


I ova bouse varijabla je nepotrebna - tako da je možeš izbrisati iz komande.
Aldin Begovic
4
Made Man
3. Apr. 2012.
Joey_ wrote on April 3, 2012, 8:38 am:
Ovaj dio koda:

if( bouse != 255 || GetPVarInt(playerid, "Firma") != 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}


Bi trebao izgledati ovako (po tvom sadašnjem kodu):

if(GetPVarInt(playerid, "Firma") == 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}


I ova bouse varijabla je nepotrebna - tako da je možeš izbrisati iz komande.

Sada kad kucam /kupifirmu ne izbacuje nista niti hoce da kupi :😕 sta ne valja u komandi
COMMAND:kupifirmu(playerid, params[])
{
#pragma unused params
new string[ 128 ], stringt;
if(GetPVarInt(playerid, "Firma") == 255)
{
SendClientMessage( playerid, WHITE, "*Vec posjedujes firmu." );
return 1;
}
if(GetPVarInt(playerid, "Firma") == 255)
{
for(new b = 0; b < sizeof(Businesses); b++)
{
    if(IsPlayerInRangeOfPoint( playerid, 5, Businesses, Businesses, Businesses) )
    {
        if(strcmp(Businesses, "Niko", true) == 0 )
{
if(Businesses == -1)
{
    SendClientMessage( playerid, WHITE, "*Zao nam je ova firma nije na prodaji." );
}
else
{
    if( GetPlayerMoney(playerid) >= Businesses && GetPVarInt(playerid, "Level") >= Businesses)
    {
new sendername;
        GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Businesses, sendername, 0, strlen(sendername), 255);
        GivePlayerMoney(playerid, -Businesses);
format( stringt, sizeof( stringt ), "~y~Kupili ste firmu za: ~g~%d$", Businesses);
                            SetPVarInt(playerid, "Firma",b);
Businesses = 1;
OnPropTextdrawUpdate();
SaveBusiness( b );

  if(Businesses == 1)
{
ShowPlayerDialog(playerid, PRODAVNICAMENU, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}24/7 Supermarket","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 2)
{
ShowPlayerDialog(playerid, CLOTHMENU, DIALOG_STYLE_LIST, "Odaberi interijer - {FFFF00}Clothes Shop","{0080C0}Binco\n{0080C0}Didier Sachs\n{0080C0}Sub Urban\n{0080C0}Victim \n{0080C0}ZIP", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 7)
{
ShowPlayerDialog(playerid, 4891, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Gun Shop","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3\n{0080C0}Interijer 4", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 10)
{
ShowPlayerDialog(playerid, 5105, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Teretana","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 3)
{
ShowPlayerDialog(playerid, 8504, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - Kafana","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 4)
{
ShowPlayerDialog(playerid, 8958, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Restoran","{0080C0}Interijer 1\n{0080C0}Interijer 2", "Odaberi", "Ponisti");
return 1;
}
if(Businesses == 5)
{
Businesses = - 100.42053222656;
Businesses = -24.546438217163;
Businesses = 1000.71875;
Businesses = 3;
SaveBusiness( b );
return 1;
}
if(Businesses == 6)
{
Businesses = 363.72998046875;
Businesses = -74.745864868164;
Businesses = 1001.5078125;
Businesses = 10;
SaveBusiness( b );
return 1;
}
if(Businesses == 8)
{
Businesses = 365.03305053711;
Businesses = -11.412439346313;
Businesses = 1001.8515625;
Businesses = 9;
SaveBusiness( b );
return 1;
}
if(Businesses == 9)
{
Businesses = 493.4958190918;
Businesses = -24.089570999146;
Businesses = 1000.6796875;
Businesses = 17;
SaveBusiness( b );
return 1;
}
        SaveBusiness( b );

    }
    else
    {
        SendClientMessage( playerid, WHITE, "*Nemas dovoljno novca da kupis ovu firmu ili nemas dovoljno veliki level." );
    }
    }
}
    }
}
for(new b = 0; b < sizeof(SBusinesses); b++)
{
    if(IsPlayerInRangeOfPoint( playerid, 5, SBusinesses, SBusinesses, SBusinesses) )
    {
        if(strcmp(SBusinesses, "Niko", true) == 0 )
{
if(SBusinesses == -1)
{
    SendClientMessage( playerid, WHITE, "*Zao nam je ova firma nije na prodaji." );
}
else
{
    if( GetPlayerCash(playerid) >= SBusinesses &&  GetPVarInt(playerid, "Level") >= SBusinesses)
    {
new sendername;
format( stringt, sizeof( stringt ), "~y~Kupili ste firmu za: ~g~%d$", SBusinesses);
        GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBusinesses, sendername, 0, strlen(sendername), 255);
        GivePlayerMoney(playerid, -SBusinesses);
        format( string, sizeof( string ), "Cestitamo! Sada ste vlasnik: %s.", SBusinesses );
        SendClientMessage( playerid, ANNOUNCEMENT, string);
        SetPVarInt(playerid, "Firma",b);
SBusinesses = 1;
OnPropTextdrawUpdate();
SaveSBusiness( b );
    }
    else
    {
        SendClientMessage( playerid, WHITE, "*Nemas dovoljno novca da kupis ovu firmu ili nemas dovoljno veliki level." );
    }
    }
}
else
{
    SendClientMessage( playerid, WHITE, "*Zao nam je ova firma nije na prodaji!" );
}
    }
}
}
return 1;
}
Johnâ„¢
5
Godfather
3. Apr. 2012.
Umjesto ovog:

if(GetPVarInt(playerid, "Firma") == 255)
{
for(new b = 0; b < sizeof(Businesses); b++)


Stavi ovo:

if(GetPVarInt(playerid, "Firma") != 255)
{
for(new b = 0; b < sizeof(Businesses); b++)
Aldin Begovic
4
Made Man
3. Apr. 2012.
hwala brate radi ! Slabo znam sa ovim pvarovima pa non stop me zeza !hwala i wozdra
Johnâ„¢
5
Godfather
3. Apr. 2012.
NiÅ¡ta i drugi put. 😉

Problem riješen - LOCK.

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha