SA-MP Forums Archive
[FilterScript] Z-Weapon Eazy System - Simple - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Z-Weapon Eazy System - Simple (/showthread.php?tid=395110)



Z-Weapon Eazy System - zProfessional - 25.11.2012

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;




Re: Z-Weapon Eazy System - Simple - gnoomen2 - 28.11.2012

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


Re: Z-Weapon Eazy System - Simple - [Dejo] - 28.11.2012

Fine! Keep it up!


Re: Z-Weapon Eazy System - Simple - WizBoy - 28.11.2012

Simple But very useful for DM Servers



Respuesta: Z-Weapon Eazy System - Simple - Gryphus One - 29.11.2012

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.


Re: Z-Weapon Eazy System - Simple - jason331 - 29.11.2012

what if a player has 0 cash and buys a gun ?


Re: Z-Weapon Eazy System - Simple - SwisherSweet - 29.11.2012

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


Re: Z-Weapon Eazy System - Simple - zProfessional - 23.01.2013

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


Re: Z-Weapon Eazy System - Simple - MyNinja - 23.01.2013

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!");



Re: Z-Weapon Eazy System - Simple - theomanking - 23.01.2013

Nice +reped


Re: Z-Weapon Eazy System - Simple - Djean - 23.01.2013

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.


Re: Z-Weapon Eazy System - Simple - zProfessional - 23.05.2013

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


Re: Z-Weapon Eazy System - Simple - Sellize - 15.06.2013

You Have Been Bought Weapon! (dat grammar)


Re: Z-Weapon Eazy System - Simple - Tuntun - 16.06.2013

Sorry not bad but a kid also can make this..


Re: Z-Weapon Eazy System - Simple - gogokickup - 16.06.2013

Simpl yet nicely done


Re: Z-Weapon Eazy System - Simple - BlackHorse - 16.06.2013

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 -