[FilterScript] Easy Weapon By [xB]Lordz
#1

Hi Guys This Is My First Script Ever.

EASY WEAPON


Commands

/ammo >> To See A List Of Weapon Commands

/ak47
/m4
/crifle
/sniper
/mp5
/tec9
/uzi
/shotgun
/cshotgun
/swanoff
/knife
/katana
/pistol
/spistol
/deagle
/grenade
/moltov


Download

Pastebin

Script
pawn Код:
/*
==========================================================================================================================

==========================================================================================================================

 

                                                                Copyright © , EasyWeapon™

__________________________________________________________________________________________________________________________

 

--------------------------   Easy Weapon v1.0 BETA -----------------------------

 

__________________________________________________________________________________________________________________________

 

==========================================================================================================================

==========================================================================================================================

My First Script Ever.

I Hope You Guys Wont Change My Credits

*/


 

 

#define FILTERSCRIPT

 

#include <a_samp>

 

#if defined FILTERSCRIPT

 

#pragma tabsize 0

 

 

public OnFilterScriptInit()

{

        print("\n--------------------------------------");

        print("    Easy Weapon v1.0 Loading...");

        print("--------------------------------------\n");

        print("               50% Loaded");

        print("              100% Loaded");

        print("\n--------------------------------------------");

        print(" Easy Weapon v1.0 By [xB]Lordz Loaded Successfully");

        print("----------------------------------------------\n");

        return 1;

}

 

public OnFilterScriptExit()

{

        return 1;

}

#else

 

#endif

public OnPlayerCommandText(playerid, cmdtext[])

{

        if (strcmp("/ak47", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,30,200);

        GivePlayerMoney(playerid,-1000);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a AK-47 For $1000!");

        return 1;

        }

        if (strcmp("/m4", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,31,200);

        GivePlayerMoney(playerid,-1000);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a M4 For $1000!");

        }

        if (strcmp("/crifle", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,33,75);

        GivePlayerMoney(playerid,-1200);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a Country-Rifle For $1200!");

        return 1;

        }

        if (strcmp("/sniper", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,34,10);

        GivePlayerMoney(playerid,-1800);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a Sniper-Rifle For $1800!");

        }

        if (strcmp("/mp5", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,29,500);

        GivePlayerMoney(playerid,-500);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a MP5 For $500!");

        return 1;

        }

        if (strcmp("/tec9", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,32,200);

        GivePlayerMoney(playerid,-500);

        SendClientMessage(playerid, 0x33CCFFAA, "You have bought a TEC-9 For $500!");

        return 1;

        }

        if (strcmp("/uzi", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,28,200);

        GivePlayerMoney(playerid,-500);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Uzi For $500!");

        return 1;

        }

        if (strcmp("/pistol", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,22,200);

        GivePlayerMoney(playerid,-200);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Pistol For $200!");

        return 1;

        }

        if (strcmp("/spistol", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,23,200);

        GivePlayerMoney(playerid,-200);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Silenced-Pistol For $200!");

        return 1;

        }

        if (strcmp("/deagle", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,24,100);

        GivePlayerMoney(playerid,-250);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Desert-Eagle For $250!");

        return 1;

        }

        if (strcmp("/knife", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,4,100);

        GivePlayerMoney(playerid,-50);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Knife For $50!");

        return 1;

        }

        if (strcmp("/katana", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,8,100);

        GivePlayerMoney(playerid,-100);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Katana For $100!");

        return 1;

        }

        if (strcmp("/shotgun", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,25,100);

        GivePlayerMoney(playerid,-800);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Shotgun For $800!");

        return 1;

        }

        if (strcmp("/cshotgun", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,27,50);

        GivePlayerMoney(playerid,-800);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Combat-ShotGun For $800!");

        return 1;

        }

        if (strcmp("/swanoff", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,26,100);

        GivePlayerMoney(playerid,-800);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Swanoff-Sho Gun For $800!");

        return 1;

        }

        if (strcmp("/grenade", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,16 ,1);

        GivePlayerMoney(playerid,-2000);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Grenade For $2000!");

        }

        if (strcmp("/moltov", cmdtext, true, 10) == 0)

        {

        GivePlayerWeapon(playerid,18,1);

        GivePlayerMoney(playerid,-1500);

        SendClientMessage(playerid,0x33CCFFAA,"You Have Bought A Moltov For $1500!");

        }

        if (strcmp("/ammo", cmdtext, true, 10) == 0)

        {

        SendClientMessage(playerid,0x33FF33AA,"=====================================================================");

        SendClientMessage(playerid,0x33FF33AA,"                          Easy Weapon v1.");

        SendClientMessage(playerid,0x33FF33AA,"=========================By [xB]Lordz====================================");

        SendClientMessage(playerid,0xFF9900AA,"Rifles: /ak47 [$1000], /m4 [$1000], /crifle [$1200], /sniper [$1000]");

        SendClientMessage(playerid,0xFF9900AA,"Sub-Machines: /tec9 [$500], /uzi [$500], /mp5 [$500]");

        SendClientMessage(playerid,0xFF9900AA,"Pistols: /pistol [$200], /spistol [$200], /deagle [$250]");

        SendClientMessage(playerid,0xFF9900AA,"Misc: /knife [$50], /katana [$100]");

        SendClientMessage(playerid,0xFF9900AA,"Shotguns: /shotgun [$800], /cshotgun [$800], /swanoff [$800]");

        SendClientMessage(playerid,0xFF9900AA,"Explosives: /grenade [$2000], /moltov [$1500]");

                return 1;

        }

 return 0;

}
================================================== =====================================
Easy Weapon By [xB]Lordz
================================================== =====================================
Please Repute Me If U Like This Script.

If You Find Any Trouble With Bugs Please PM Or Post It Here.

---------------------------------------------------------------------------------------------------------------


03-01-2014:
Well yeah, this is my first ever script created for SA-MP. A user named "sniperwars" have submitted a link years ago however at that time I always thought of updating this script. Unfortunately, I had no PC at that time and postponed, but now, I'm no longer working into this. A much more better version, I credit sniperwars for it.

http://pastebin.com/JvMc0DeX

However, the v1 can be implemented to spawn weapons quickly.
Reply
#2

Could be placed in dialog!
More is great.
Reply
#3

Changes And Dialog Will Be Added On v2.0
Reply
#4

good,how about adding more weapons? Flamethrower,dildo etc for fun.
Reply
#5

pawn Код:
CMD:ak47(playerid, params[])
{
    GivePlayerWeapon(playerid, 30, 500);
    return 1;
}
Could be improved alot but it's good for your first.
Reply
#6

Good JoB
Reply
#7

My first realease was a Speedometer, but this first release it's cool.
Very good man.
Reply
#8

good job i was searching yesterday about script like this for my server
thank u
reped
Reply
#9

It's good if players want to quickly spawn a weapon without having to open a dialog then browse through, though /weapon [weapon name/id] would be better.
Reply
#10

Quote:
Originally Posted by MP2
Посмотреть сообщение
It's good if players want to quickly spawn a weapon without having to open a dialog then browse through, though /weapon [weapon name/id] would be better.
pawn Код:
if(strcmp(cmd, "/weapon", true) == 0)
{
    new choose[256];
    choose = strtok(cmdtext, idx);
    if(!strlen(choose)) {
        SendClientMessage(playerid, COLOR_WHITE, "[USAGE:] /weapon [weapon id/weapon name]");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ Weapons _______|");
        SendClientMessage(playerid, COLOR_GRAD1, "| AK47(30) - $5,000, MP5 - $3,500");
        return 1;
    }
    if(strcmp(choose,"AK47",true) == 0 || (strcmp(choose,"30",true) == 0) && GetPlayerMoney(playerid)>=50000)
        GivePlayerMoney(playerid, - 5000);
        SendClientMessage(playerid,COLOR_WHITE,"[{33CCFF}INFO{FFFFFF}]: You have bought an AK-47.");
    }
    blablabla....just continue it.
    else
    {
        SendClientMessage(playerid,COLOR_GRAD2,"[{660000}ERROR{FFFFFF}]: Not enough money or invalid weapon!");
        return 1;
    }
    return 1;
}
Just continue it and stuff.

OFFT: Small question, how can I make this :
pawn Код:
if(strcmp(choose,"AK47",true) == 0
Check aswell another thing, for example it's ID(example :
pawn Код:
if(strcmp(choose,"AK47",true) == 0 && (strcmp(choose,"30",true) == 0
Thanks.

EDIT: I understood how, it's
pawn Код:
if(strcmp(choose,"AK47",true) == 0 || (strcmp(choose,"30",true) == 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)