[FilterScript] Z-Weapon Eazy System - Simple
#1

Hey Guys heres My second filterscript
the weapon system

Photos:
Later On

Downloads:
PHP код:
//My Second FS
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Easy Weapon Spawner By zProfessional Is Loaded");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n--------------------------------------");
    print(
" Easy Weapon Spawner By zProfessional Is unLoaded");
    print(
"--------------------------------------\n");
    return 
1;
}
#else
main()
{
    print(
"\n----------------------------------");
    print(
" Any Gamemode");
    print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}
public 
OnGameModeExit()
{
    print(
"\n--------------------------------------");
    print(
" Easy Weapon Spawner By zProfessional Is Unloaded");
    print(
"--------------------------------------\n");
    return 
1;
}
CMD:9mm(playerid,params[])
{
    
GivePlayerWeapon(playerid,22,9999);
    
GivePlayerMoney(playerid,-5000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A 9mm Pistol For $5000, With 9k Ammo.");
    return 
1;
}
CMD:shotgun(playerid,params[])
{
    
GivePlayerWeapon(playerid,26,9999);
    
GivePlayerMoney(playerid,-5000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Pump Shotgun For $5000, With 9k Ammo.");
    return 
1;
}
CMD:mp5(playerid,params[])
{
    
GivePlayerWeapon(playerid,29,9999);
    
GivePlayerMoney(playerid,-5000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A MP5 Machine Gun For $5000, With 9k Ammo.");
    return 
1;
}
CMD:m4(playerid,params[])
{
    
GivePlayerWeapon(playerid,31,9999);
    
GivePlayerMoney(playerid,-6000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A M4A1 For $6000, With 9k Ammo.");
    return 
1;
}
CMD:sniper(playerid,params[])
{
    
GivePlayerWeapon(playerid,34,9999);
    
GivePlayerMoney(playerid,-6000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Sniper Rifle For $6000, With 9k Ammo.");
    return 
1;
}
CMD:rocket(playerid,params[])
{
    
GivePlayerWeapon(playerid,36,9999);
    
GivePlayerMoney(playerid,-7000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Heat Seeking rocket For $7000, With 9k Ammo");
    return 
1;
}
CMD:minigun(playerid,params[])
{
    
GivePlayerWeapon(playerid,38,9999);
    
GivePlayerMoney(playerid,-10000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Minigun For $10000, With 9k Ammo.");
    return 
1;
}
CMD:timebomb(playerid,params[])
{
    
GivePlayerWeapon(playerid,39,9999);
    
GivePlayerMoney(playerid,-4000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Time Bomb For $4000, With 9k Bombs.");
    return 
1;
}
CMD:camera(playerid,params[])
{
    
GivePlayerWeapon(playerid,43,9999);
    
GivePlayerMoney(playerid,-3000);
    
SendClientMessage(playerid0x0000FF"You Have Been Bought A Camera For $3000, With 9k Shots.");
    return 
1;
}
CMD:wm(playerid,params[])
{
    
ShowPlayerDialog(playerid,1DIALOG_STYLE_MSGBOX,"{00FFFF}Weapon List","{FFFFFF}The Commands Are:\n{C0C0C0}/9mm\n{C0C0C0}/shotgun\n{C0C0C0}/mp5\n{C0C0C0}/m4\n{C0C0C0}/sniper\n{C0C0C0}/rocket\n{C0C0C0}/minigun\n{C0C0C0}/timebomb\n{C0C0C0}/camera\n{FFFFFF}More Are Coming Soon""Close","Close");
    
SetPlayerSkin(playerid0);
    
GivePlayerMoney(playerid,-5);
    
SendClientMessage(playerid0x00FFFF"You Are Now Viewing The Weapon List To Buy.");
    return 
1;

Reply
#2

Maybe a list of the guns like /gunlist and all the commands for guns comes up, and even more guns!
Good job, keep it up
Reply
#3

Fine! Keep it up!
Reply
#4

Simple But very useful for DM Servers
Reply
#5

I think you should remove the code from the callback OnGameModeInit, or even remove the entire callback itself. Also, you need to add #define FILTERSCRIPT in top of your code.
Reply
#6

what if a player has 0 cash and buys a gun ?
Reply
#7

lol this does not even check if player has money...next time use
GetPlayerMoney(playerid, 1000);
Because player can just buy the weapons without anymoney(fail)
Also very simple next time make in a dialog.
1/10
Reply
#8

Quote:
Originally Posted by gnoomen2
Посмотреть сообщение
Maybe a list of the guns like /gunlist and all the commands for guns comes up, and even more guns!
Good job, keep it up
Ok i will add it in next update @avenger k i will edit it
Reply
#9

Very simple, maybe add a dialog to show the weapons, easier, and better? I'll rate this 6/10, good job

Edit : You can also use variables to reduce the cases, in understandable form, shorten it, and also makes it easier to manage and edit. I've taken this ammunition piece of code from a SQLite TDM GM I'm developing. Hope this makes you learn something!

Example :

pawn Код:
new price, weaponid, ammo;

    switch(listitem)
    {
        case 0: { price = 100, weaponid = 18, ammo = 1; }
        case 1: { price = 100, weaponid = 24, ammo = 1; }
        case 2: { price = 1500, weaponid = 16, ammo = 100; }
        case 3: { price = 2500, weaponid = 21, ammo = 200; }
        case 4: { price = 2500, weaponid = 3, ammo = 500; }
        // and more and more
    }
   
    if(GetPlayerMoney(playerid) < price)
        return SendClientMessage(playerid, 0x0000FFAA, "Sorry, you don't have enough money to buy the weapon!");

    GivePlayerMoney(playerid, -price);
    GivePlayerWeapon(playerid, weaponid, ammo);
    SendClientMessage(playerid, 0x00FFFFAA, "Great, you have successfully bought the weapon!");
Reply
#10

Nice +reped
Reply
#11

I will admit, This is pretty Simple and straight forward, Maybe add a Dialog and make it check if the Player has cash on them to buy weapons. Good job for the effort.
Reply
#12

Quote:
Originally Posted by Djean
Посмотреть сообщение
I will admit, This is pretty Simple and straight forward, Maybe add a Dialog and make it check if the Player has cash on them to buy weapons. Good job for the effort.
Well Ok
Reply
#13

You Have Been Bought Weapon! (dat grammar)
Reply
#14

Sorry not bad but a kid also can make this..
Reply
#15

Simpl yet nicely done
Reply
#16

This is a FS so why you added GM things like OnGamemodeInit()
But this is fine keep it up not reped and you need to add this when player haven't money player can't buy any thing but in this money go to -
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)