[pomoc] Prodavnica oruzja

Započeo sampzone, April 11, 2011, 15:29:59 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

mod koji ja koristim: Street Stories
problem: problem je u tome sto je jedan moj drug napravio fs prodavnice oruzja ali kada hocu da kupim oruzje izbaci mi meni ja ornacim da kipum tj kupim ali mi neda oruzje i neskida mi pare mozel pomoc

skripta


#include <a_samp>
#define ZELENO 0x33AA33AA
new oruzje;
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
new string[128];
new sendername[MAX_PLAYER_NAME];

public OnGameModeInit()
{
    print("\n--------------------------------------");
    print("     FS kupovanje oruzja by N1n0       ");
    print("--------------------------------------\n");
    Create3DTextLabel("Los Santos\nProdavnica Oruzja",0x00C3FFFF, 1367.3910,-1279.7725,13.5469, 50,0,3);
    Create3DTextLabel("Kucajte /oruzje za meni oruzja",0x00C3FFFF, 308.5346,-141.4474,999.6016, 50,0,3);
   return 1;
}

public OnGameModeExit()
{
   return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,ZELENO,"***Zelite oruzja? Odite u Los Santos Prodavnicu Oruzja i kupite! (/oruzje)***");
   return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp("/oruzje", cmdtext, true, 10) == 0)
   {
        if(PlayerToPoint(4.0,playerid,308.5346,-141.4474,999.6016))
        {
      ShowPlayerDialog(playerid,oruzje, DIALOG_STYLE_LIST, "Kupovina oruzja:", "Pancir (1000$) \nNoz (10$)\nBokser (5$)\nBeizbolska Palica (8$)\nKatana (12$)\n9mm Pistolj (500$)\nTihi 9mm (700$)\nDesert Eagle (900$)\nShotgun (1000$)\nSawn-off Shotgun (1200$)\nCombat Shotgun (1400$)\nMicro SMG (1000$)\nSMG (1500$)\nAK47 (2000$)\nM4 (2100$)\nTec9 (800$)\nSniper (3000$)", "Izaberi", "Izadji");
        GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "%s je kucao /oruzje!", sendername);
      SendClientMessage(playerid, ZELENO, string);
      }
      else
      {
       SendClientMessage(playerid,ZELENO,"Moras biti u Los Santos Prodavnici Oruzja!");
      }
      return 1;
   }
   return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(dialogid == oruzje)
   {
   if(response)
   {
   if(listitem == 0)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Pancir!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   SetPlayerArmour(playerid,100);
   GivePlayerMoney(playerid,-1000);
    }
   if(listitem == 1)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Noz!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,4,1);
   GivePlayerMoney(playerid,-10);
    }
      if(listitem == 2)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Bokser!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,1,1);
   GivePlayerMoney(playerid,-5);
    }
      if(listitem == 3)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Beizbolsku Palicu!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,5,1);
   GivePlayerMoney(playerid,-8);
    }
      if(listitem == 4)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Katanu!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,8,1);
   GivePlayerMoney(playerid,-12);
    }
   if(listitem == 5)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si 9mm Pistolj!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,22,500);
   GivePlayerMoney(playerid,-500);
    }
      if(listitem == 6)
   {
   format(string, sizeof(string), "Cestitamo %s,Pistolj sa Prigusivacem!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,23,500);
   GivePlayerMoney(playerid,-700);
    }
    if(listitem == 7)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Desert Eagle!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,24,500);
   GivePlayerMoney(playerid,-900);
    }
      if(listitem == 8)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Shotgun!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,25,500);
   GivePlayerMoney(playerid,-1000);
    }
      if(listitem == 9)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Sawn-off Shotgun!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,26,500);
   GivePlayerMoney(playerid,-1200);
    }
      if(listitem == 10)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Combat Shotgun!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,27,500);
   GivePlayerMoney(playerid,-1400);
    }
      if(listitem == 11)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Micro SMG!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,28,1000);
   GivePlayerMoney(playerid,-1000);
    }
      if(listitem == 12)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si SMG!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,29,1000);
   GivePlayerMoney(playerid,-1500);
    }
      if(listitem == 13)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si AK47!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,30,1500);
   GivePlayerMoney(playerid,-2000);
    }
    if(listitem == 14)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si M4!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,31,1500);
   GivePlayerMoney(playerid,-2100);
    }
      if(listitem == 15)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Tec9!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,32,500);
   GivePlayerMoney(playerid,-800);
    }
      if(listitem == 16)
   {
   format(string, sizeof(string), "Cestitamo %s,kupio si Sniper!", sendername);
   GameTextForPlayer(playerid,string, 4000, 3);
   GivePlayerWeapon(playerid,34,50);
   GivePlayerMoney(playerid,-3000);
    }
   }
   return 1;
    }
    return 0;
}

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
   {
      new Float:oldposx, Float:oldposy, Float:oldposz;
      new Float:tempposx, Float:tempposy, Float:tempposz;
      GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      tempposx = (oldposx -x);
      tempposy = (oldposy -y);
      tempposz = (oldposz -z);
      if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
      {
         return 1;
      }
   }
   return 0;
}

evo  ::)

#include <a_samp>
#define ZELENO 0x33AA33AA
#define ORUZJE 562
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
new string[128];
new sendername[MAX_PLAYER_NAME];

public OnGameModeInit()
{
    print("\n--------------------------------------");
    print("     FS kupovanje oruzja by N1n0       ");
    print("--------------------------------------\n");
    Create3DTextLabel("Los Santos\nProdavnica Oruzja",0x00C3FFFF, 1367.3910,-1279.7725,13.5469, 50,0,3);
    Create3DTextLabel("Kucajte /oruzje za meni oruzja",0x00C3FFFF, 308.5346,-141.4474,999.6016, 50,0,3);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,ZELENO,"***Zelite oruzja? Odite u Los Santos Prodavnicu Oruzja i kupite! (/oruzje)***");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/oruzje", cmdtext, true, 10) == 0)
{
        if(PlayerToPoint(4.0,playerid,308.5346,-141.4474,999.6016))
        {
ShowPlayerDialog(playerid,ORUZJE, DIALOG_STYLE_LIST, "Kupovina oruzja:", "Pancir (1000$) \nNoz (10$)\nBokser (5$)\nBeizbolska Palica (8$)\nKatana (12$)\n9mm Pistolj (500$)\nTihi 9mm (700$)\nDesert Eagle (900$)\nShotgun (1000$)\nSawn-off Shotgun (1200$)\nCombat Shotgun (1400$)\nMicro SMG (1000$)\nSMG (1500$)\nAK47 (2000$)\nM4 (2100$)\nTec9 (800$)\nSniper (3000$)", "Izaberi", "Izadji");
        GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s je kucao /oruzje!", sendername);
SendClientMessage(playerid, ZELENO, string);
}
else
{
    SendClientMessage(playerid,ZELENO,"Moras biti u Los Santos Prodavnici Oruzja!");
}
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(dialogid == ORUZJE)
{
if(response)
{
if(listitem == 0)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Pancir!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
SetPlayerArmour(playerid,100);
GivePlayerMoney(playerid,-1000);
    }
if(listitem == 1)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Noz!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,4,1);
GivePlayerMoney(playerid,-10);
    }
    if(listitem == 2)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Bokser!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,1,1);
GivePlayerMoney(playerid,-5);
    }
    if(listitem == 3)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Beizbolsku Palicu!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,5,1);
GivePlayerMoney(playerid,-8);
    }
    if(listitem == 4)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Katanu!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,8,1);
GivePlayerMoney(playerid,-12);
    }
if(listitem == 5)
{
format(string, sizeof(string), "Cestitamo %s,kupio si 9mm Pistolj!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,22,500);
GivePlayerMoney(playerid,-500);
    }
    if(listitem == 6)
{
format(string, sizeof(string), "Cestitamo %s,Pistolj sa Prigusivacem!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,23,500);
GivePlayerMoney(playerid,-700);
    }
    if(listitem == 7)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Desert Eagle!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,24,500);
GivePlayerMoney(playerid,-900);
    }
    if(listitem == 8)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Shotgun!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,25,500);
GivePlayerMoney(playerid,-1000);
    }
    if(listitem == 9)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Sawn-off Shotgun!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,26,500);
GivePlayerMoney(playerid,-1200);
    }
    if(listitem == 10)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Combat Shotgun!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,27,500);
GivePlayerMoney(playerid,-1400);
    }
    if(listitem == 11)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Micro SMG!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,28,1000);
GivePlayerMoney(playerid,-1000);
    }
    if(listitem == 12)
{
format(string, sizeof(string), "Cestitamo %s,kupio si SMG!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,29,1000);
GivePlayerMoney(playerid,-1500);
    }
    if(listitem == 13)
{
format(string, sizeof(string), "Cestitamo %s,kupio si AK47!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,30,1500);
GivePlayerMoney(playerid,-2000);
    }
    if(listitem == 14)
{
format(string, sizeof(string), "Cestitamo %s,kupio si M4!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,31,1500);
GivePlayerMoney(playerid,-2100);
    }
    if(listitem == 15)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Tec9!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,32,500);
GivePlayerMoney(playerid,-800);
    }
    if(listitem == 16)
{
format(string, sizeof(string), "Cestitamo %s,kupio si Sniper!", sendername);
GameTextForPlayer(playerid,string, 4000, 3);
GivePlayerWeapon(playerid,34,50);
GivePlayerMoney(playerid,-3000);
    }
}
return 1;
    }
    return 0;
}

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}