[FilterScript] Simple Weapon Script 1.0
#1

1.This script includes all weapons.
2.There are absolutely NO BUGS.
3.You can edit the script if you want.
4.Please don't hate on my script...
5.This is my first script...
Have fun

P.S: thanks to all who helped eliminate bugs!

Download/Script below!

Код:
// Simple Weapon Script by Aidz.

#include <a_samp>
#if defined FILTERSCRIPT
#define FILTERSCRIPT

#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/knuckles", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,1,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned brass knuckles!");
        return 1;
    }
    if (strcmp("/golf", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,2,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a golf club!");
        return 1;
    }
    if (strcmp("/niteStick", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,3,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a nite stick!");
        return 1;
    }
    if (strcmp("/knife", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,4,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a knife.!");
        return 1;
    }
    if (strcmp("/bat", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,5,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a bat!");
        return 1;
    }
    if (strcmp("/shovel", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,31,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a shovel!");
        return 1;
    }
    if (strcmp("/pool", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,7,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a pool cue!");
        return 1;
    }
    if (strcmp("/katana", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,8,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a katana!");
        return 1;
    }
    if (strcmp("/chainsaw", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,9,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a chainsaw!");
        return 1;
    }
    if (strcmp("/dildo", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,10,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a purple dildo!");
        return 1;
    }
    if (strcmp("/cane", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,15,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a cane!");
        return 1;
    }
    if (strcmp("/grenades", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,16,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned grenades!");
        return 1;
    }
    if (strcmp("/tear", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,17,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned tear gas!");
        return 1;
    }
    if (strcmp("/molotov", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,18,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned molotov cocktails!");
        return 1;
    }
    if (strcmp("/colt", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,22,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a 9mm!");
        return 1;
    }
    if (strcmp("/silenced", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,23,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a silenced 9mm!");
        return 1;
    }
    if (strcmp("/eagle", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,24,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a desert eagle!");
        return 1;
    }
    if (strcmp("/de", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,24,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a desert eagle!" );
        return 1;
    }
    if (strcmp("/shotgun", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,25,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a shotgun!");
        return 1;
    }
    if (strcmp("/spawnoff", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,26,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a spawn-off shotgun.");
        return 1;
    }
    if (strcmp("/combat", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,27,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a combat shotgun ");
        return 1;
    }
    if (strcmp("/uzi", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,28,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a uzi!");
        return 1;
    }
    if (strcmp("/mp5", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,29,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a mp5!");
        return 1;
    }
    if (strcmp("/ak", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,30,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a ak47!");
        return 1;
    }
    if (strcmp("/m4", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,31,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a m4!");
        return 1;
    }
    if (strcmp("/tec9", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,32,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a tec9!");
        return 1;
    }
    if (strcmp("/rifle", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,33,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a country rifle! ");
        return 1;
    }
    if (strcmp("/sniper", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,34,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a sniper!");
        return 1;
    }
    if (strcmp("/rpg", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,35,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a rocket launcher! Go fuck shit up!");
        return 1;
    }
    if (strcmp("/heat", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,36,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a heat seaking rocket launcher!");
        return 1;
    }
    if (strcmp("/flame", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,37,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a flame thrower!");
        return 1;
    }
    if (strcmp("/minigun", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,38,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a minigun! Go fuck shit up!");
        return 1;
    }
    if (strcmp("/sat", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,39,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned satchel charges!");
        return 1;
    }
    if (strcmp("/Spray", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,41,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a spray can!");
        return 1;
    }
    if (strcmp("/fe", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,42,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a fire extinguisher!");
        return 1;
    }
    if (strcmp("/camera", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,43,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a camera!");
        return 1;
    }
    if (strcmp("/para", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,46,99999);
        SendClientMessage(playerid, 0xFFFFFFFF, "You earned a parachute!");
        return 1;
    }
    return 0;
}
#endif
Reply
#2

It's nice, and more nicer 'cuz it's your first script!
Well done mate!
And ps, I've got a tip: Make just one command (for example, "/getweapon") and then after it, typ the weapon name ,nice idea or not? (A)
Reply
#3

Good job.
Reply
#4

It's really basic, but yes, good work. Can I suggest something? Use dcmd or zcmd, which is faster to process
DCMD or ZCMD.

And yea, btw, you can remove these '#define FILTERSCRIPT', '#if defined FILTERSCRIPT' and '#endif'. They're not needed anymore.
Reply
#5

For first FS it's good!Keep up good work.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)