Author Topic: Buy weapons in all Ammu-Nation  (Read 4767 times)

0 Members and 1 Guest are viewing this topic.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Buy weapons in all Ammu-Nation
« on: November 17, 2012, 06:59:19 pm »
Traslate to english, i not have time  :o :P :D


[pawn] else if(strcmp(cmdtext, "armas", true) == 0) {
       SendClientMessage(playerid,COLOR_YELLOW ,"-----------Compra de armas-----------");
       SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar una m60 /c m60, Para comprar una ingrams /c ingrams");
       SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar una tec /c tec, Para comprar un francotirador /c laser");
       SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar chaleco antibalas /c chaleco, Para comprar una shotgun /c shotgun");
       SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar una m4 /c m4, Para comprar una stubby /c bb");
        SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar una ruger, /c ruger, Para comprar granadas, /c granadas");
        SendClientMessage(playerid,COLOR_YELLOW ,"Para comprar katana, /c katana");
      SendClientMessage(playerid,COLOR_YELLOW ,"---Puedes comprar en cualquier Ammunation---");
       return 1;
       }
   

        else if(strcmp(cmdtext, "chaleco", true) == 0) {
      if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)) {
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste chaleco!");
           SetPlayerArmour(playerid,99);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar chaleco!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

         else if(strcmp(cmdtext, "laser", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Francotirador!");
           SetPlayerWeapon(playerid,29,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Francotirador!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

            else if(strcmp(cmdtext, "bb", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Stubby shotgun!");
           SetPlayerWeapon(playerid,21,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Francotirador!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

            else if(strcmp(cmdtext, "m4", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste M4!");
           SetPlayerWeapon(playerid,26,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar M4!");
           }
         }
           else
           {
          SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

               else if(strcmp(cmdtext, "tec", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Tec9!");
           SetPlayerWeapon(playerid,22,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Tec9!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                  else if(strcmp(cmdtext, "ingrams", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Ingrams!");
           SetPlayerWeapon(playerid,24,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Ingrams!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }


               else if(strcmp(cmdtext, "ruger", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Ruger!");
           SetPlayerWeapon(playerid,27,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Ruger!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                  else if(strcmp(cmdtext, "shotgun", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Shotgun!");
           SetPlayerWeapon(playerid,19,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Shotgun!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                     else if(strcmp(cmdtext, "granadas", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Shotgun!");
           SetPlayerWeapon(playerid,12,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Granadas!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                  else if(strcmp(cmdtext, "vida", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Vida!");
           SetPlayerHealth(playerid,100.0);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Vida!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                     else if(strcmp(cmdtext, "katana", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste Katana!");
           SetPlayerWeapon(playerid,10,1);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar Katana!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }

                     else if(strcmp(cmdtext, "m60", true) == 0) {
       if(PlayerToPoint(5, playerid,364.11175, 1059.95654, 19.19139) || PlayerToPoint(5, playerid,-63.83909, -1477.56042, 10.44908) || PlayerToPoint(5, playerid,-673.11517, 1204.90148, 11.10896)){
           new cash = GetPlayerMoney(playerid);
             if(cash >= 1000) {
           SendClientMessage(playerid,COLOR_YELLOW,"Compraste M60!");
           SetPlayerWeapon(playerid,32,1000);
           DecPlayerHandCash(playerid,1000);
          }
           if(cash < 999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $1000 para comprar M60!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Debes estar en Ammu-Nation");
           }
       return 1;
   }[/pawn] 

DO YOU LIKE MY COMMANDS?? GIVE ME THANKS OR CREDITS IN YOU SCRIPT.. AND I CREATE MORE COMMANDS FOR FUN
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Buy weapons in all Ammu-Nation
« Reply #1 on: December 03, 2012, 12:53:47 am »
i don't under stand ( PlayerToPoint?, DecPlayerHandCash?,) where is the [ stock or public ] that goes with those

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: Buy weapons in all Ammu-Nation
« Reply #2 on: December 03, 2012, 01:38:14 am »
use:
[pawn]public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    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;
}[/pawn]

DecPlayerHandCash

[pawn]public DecPlayerCash(playerid,amount)
{
   new mon = GetPlayerCash(playerid)-amount;
    format(INFO,256, REGISTERS, gPlayers[playerid]);
   dini_IntSet(INFO, "Cash", mon);
   SetPlayerMoney(playerid,mon);
}[/pawn]

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Buy weapons in all Ammu-Nation
« Reply #3 on: December 03, 2012, 06:26:26 pm »
Quote
   new mon = GetPlayerCash(playerid)-amount;
    format(INFO,256, REGISTERS, gPlayers[playerid]);
   dini_IntSet(INFO, "Cash", mon);
   SetPlayerMoney(playerid,mon);

dude, where is INFO defined, also, what's the point of writing into a file which will never be used ( he is clearly not using GUPS ).
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Buy weapons in all Ammu-Nation
« Reply #4 on: December 06, 2012, 09:15:04 pm »
nice +rep just remember all your defines, stocks, and public's

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: Buy weapons in all Ammu-Nation
« Reply #5 on: December 06, 2012, 09:41:20 pm »
nice +rep just remember all your defines, stocks, and public's
i forget put the public playertopoint  :D
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint