[pomoc] oko komande /buygun

Započeo Nemanja King
9. Maj 2011. Zaključano
703
pregleda
5
postova
SyBeR
3
Hustler
9. Maj 2011.
Skripta koju koristim: BU edit
Detaljan opis problema: udjem u bizz ammunation da kupim gun,i kada kucam /buygun pise mi server unknow comand,promenik koordinate u komandi /buygun i radi prvih 2-3 puta,i posle opet isto
Dio skripte:
if (strcmp(cmd, "/buygun", true) == 0 || strcmp(cmd, "/kupioruzije", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
if(PlayerInfo < 2)
{
SendClientMessage(playerid, COLOR_GREY, "   Morate biti level 2! ");
return 1;
}
       if(GetPlayerMoney(playerid) < 1)
{
   SendClientMessage(playerid, COLOR_GREY, "   Nemate dovoljno novca kod sebe !");
   return 1;
}
new gun;
new gunid;
// new gunstring1;
// new gunstring2;
new gunstring3;
new gunstring4;
// new gunstring5;
new infostring;
new guncharge;
new ammocharge;
new location = PlayerInfo;
if(location == 99 || location == 100 || location == 102 || location == 105)
{
   if(BizzInfo[location-99] <= 0)
   {
       GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
return 1;
   }
new mod = 100;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Koriscenje: /kupioruzije [ime oruzija] ");
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessage(playerid, COLOR_WHITE,"*** Oruzije & Municija ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
/* format(gunstring1, 256, "Oruzije: parachute ($%d) golfclub ($%d) nightstick ($%d) baseballbat ($%d) shovel ($%d) poolcue ($%d)",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring1);
format(gunstring2, 256, "Oruzije: purpledildo ($%d) whitedildo ($%d) longwhitedildo ($%d) whitedildo2 ($%d) flowers ($%d) cane",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring2);*/
format(gunstring3, 256, "Oruzije: sdpistolj ($%d) dezert ($%d) tec9 ($%d) uzi ($%d) hekler ($%d)",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring3);
format(gunstring4, 256, "Oruzije: pumparica ($%d) kalas ($%d) m4 ($%d) puska ($%d) snajper ($15000)",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring4);
/* format(gunstring5, 256, "Oruzije: pistolammo ($50) shotgunammo ($%d) smgammo ($%d) assaultammo ($%d) rifleammo ($%d)",
GunPrice,GunPrice,GunPrice,GunPrice,GunPrice);
SendClientMessage(playerid, COLOR_GRAD3, gunstring5); */
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Koriscenje: /kupioruzije [ime oruzija] ");
return 1;
}
new ammo = strval(tmp);
if(ammo < 1 || ammo > 999) { SendClientMessage(playerid, COLOR_GREY, "   Kolicina municije ne smije biti ispod 1 ni veca od 999 !"); return 1; }
if (strcmp(gunid, "parachute", true, strlen(gunid)) == 0)
{
gun = 46;
guncharge = GunPrice/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "golfclub", true, strlen(gunid)) == 0)
{
gun = 2; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 2; PlayerInfo = 1;
}
else if (strcmp(gunid, "nightstick", true, strlen(gunid)) == 0)
{
gun = 3; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 3; PlayerInfo = 1;
}
else if (strcmp(gunid, "baseballbat", true, strlen(gunid)) == 0)
{
gun = 5; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 5; PlayerInfo = 1;
}
else if (strcmp(gunid, "shovel", true, strlen(gunid)) == 0)
{
gun = 6; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 6; PlayerInfo = 1;
}
else if (strcmp(gunid, "poolcue", true, strlen(gunid)) == 0)
{
gun = 7; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 7; PlayerInfo = 1;
}
else if (strcmp(gunid, "purpledildo", true, strlen(gunid)) == 0)
{
gun = 10; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 10; PlayerInfo = 1;
}
else if (strcmp(gunid, "whitedildo", true, strlen(gunid)) == 0)
{
gun = 11; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 11; PlayerInfo = 1;
}
else if (strcmp(gunid, "longwhitedildo", true, strlen(gunid)) == 0)
{
gun = 12; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 12; PlayerInfo = 1;
}
else if (strcmp(gunid, "whitedildo2", true, strlen(gunid)) == 0)
{
gun = 13; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 13; PlayerInfo = 1;
}
else if (strcmp(gunid, "flowers", true, strlen(gunid)) == 0)
{
gun = 14; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 14; PlayerInfo = 1;
}
/* else if (strcmp(gunid, "cane", true, strlen(gunid)) == 0)
{
gun = 15; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 15; PlayerInfo = 1;
} */
else if (strcmp(gunid, "sdpistolj", true, strlen(gunid)) == 0)
{
gun = 23; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 23; PlayerInfo = ammo;
}
else if (strcmp(gunid, "dezert", true, strlen(gunid)) == 0)
{
gun = 24; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 24; PlayerInfo = ammo;
}
else if (strcmp(gunid, "tec9", true, strlen(gunid)) == 0)
{
gun = 32; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else if (strcmp(gunid, "uzi", true, strlen(gunid)) == 0)
{
gun = 28; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}

else if (strcmp(gunid, "hekler", true, strlen(gunid)) == 0)
{
gun = 29; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 29; PlayerInfo = ammo;
}
else if (strcmp(gunid, "pumparica", true, strlen(gunid)) == 0)
{
gun = 25; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 25; PlayerInfo = ammo;
}
else if (strcmp(gunid, "kalas", true, strlen(gunid)) == 0)
{
gun = 30; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 30; PlayerInfo = ammo;
}
else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
gun = 31; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 31; PlayerInfo = ammo;
}
else if (strcmp(gunid, "puska", true, strlen(gunid)) == 0)
{
gun = 33; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else if (strcmp(gunid, "snajper", true, strlen(gunid)) == 0)
{
gun = 34; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else
{
SendClientMessage(playerid, COLOR_GRAD6, "Prodavac: Nikada nisam cuo za to oruzije.");
return 1;
}
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(infostring, 256, "   Nemate $%d !",guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
return 1;
}
if(GetPlayerMoney(playerid) < (guncharge+ammocharge))
{
   SendClientMessage(playerid, COLOR_GREY, "   Ne mozete priustiti to !");
   return 1;
}
new payout = guncharge + ammocharge;
format(infostring, 256, "Kupili ste %s sa %d municije za $%d",gunid,ammo,payout);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
if(location == 102 && IsACop(playerid)) { }
else { SafeGivePlayerMoney(playerid, - payout); }
BizzInfo[location-99] += payout;
ExtortionBiz(location-99, payout);
BizzInfo[location-99]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SafeGivePlayerWeapon(playerid, gun, ammo);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s je kupio oruzije za $%d u %d", sendername, payout, location-99);
printf("%s", string);
PayLog(string);
OnPropUpdate();
}
else
{
   SendClientMessage(playerid, COLOR_WHITE,"Niste u prodavnici.");
return 1;
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): http://imageshack.us/photo/my-images/571/samp190b.png/
Kruno1407
4
Made Man
9. Maj 2011.
Tebi je koliko sam ja skuzio ovo komanda
if (strcmp(cmd, "/buygun", true) == 0 || strcmp(cmd, "/kupioruzije", true) == 0)
  {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo < 2)
        {
            SendClientMessage(playerid, COLOR_GREY, "  Morate biti level 2! ");
            return 1;
        }
          if(GetPlayerMoney(playerid) < 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novca kod sebe !");
            return 1;
        }
        new gun;
        new gunid;
//        new gunstring1;
//        new gunstring2;
        new gunstring3;
        new gunstring4;
//        new gunstring5;
        new infostring;
        new guncharge;
        new ammocharge;
        new location = PlayerInfo;
if(location == 99 || location == 100 || location == 102 || location == 105)
        {
            if(BizzInfo[location-99] <= 0)
            {
                GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
              return 1;
            }
            new mod = 100;
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
              format(string, sizeof(string), "Koriscenje: /kupioruzije [ime oruzija] ");
              SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
              SendClientMessage(playerid, COLOR_WHITE,"*** Oruzije & Municija ***");
              SendClientMessage(playerid, COLOR_GRAD2,string);


Makni svugdje /* pa vidi oce li radit
SyBeR
3
Hustler
9. Maj 2011.
C:\Users\nemanja\Desktop\Balkan Underground\gamemodes\balkan-underground.pwn(28208) : error 021: symbol already defined: "gunstring2"
C:\Users\nemanja\Desktop\Balkan Underground\gamemodes\balkan-underground.pwn(28201) : warning 204: symbol is assigned a value that is never used: "gunstring2"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

1 Error.
gonss
5
Crime Lord
9. Maj 2011.
Molio bih te sledeći put da koristiš
code

Da Vam ne moram ja stalno edit post.
SyBeR
3
Hustler
9. Maj 2011.
ugodio sam moze LoCK

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha