[FilterScript] Dynamic Briefcase Sytem
#1

Hello Sa-mp Community

I'm Producing My Briefcase System

Credits To:

JimmyCh for Posting This Tutorial

I had taken Permisson From Him


Details:

Health
Armour
and
Weapon System to buy

If U want to learn How to make it Click Me! to learn How to Make it

Tutorial:

Just to be clear from the beginning, we will create a pickup, and we will use dialogs with this.
Now OnGameModeInIt, we must create the pickup, let's do something like this:


pawn Code:
mybriefcase = CreatePickup(1210, 1, X, Y, Z, -1);
Alright, let me explain this, according to the wiki, this is what it shows:


pawn Code:
CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
So we just created a pickup ID 1210 which is a briefcase(ID 1210, you can change it), type 1 which is the pickup spawn type, the coordinates X,Y,Z(Don't forget to change them, and the virtual world -1(Appears in all worlds!)

This How youu Can Change it

The Briefcase Which I made Locates at Las_Venture Area51

Download Link Click Me!


Code:
//Tutriol By Jimmy Made by NoFeAr

/************************************
|			  NoFeAr				|
|		  Briefcase system			|
|									|
************************************/

#include <a_samp>

#define COLOR_WHITE 0xFFFFFFFF

new mybriefcase;

new Float:briefcaseX = 0.0;
new Float:briefcaseY = 0.0;
new Float:briefcaseZ = 0.0;

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Tutriol By Jimmy Made by NoFeAr ");
	print("--------------------------------------\n");
	
	mybriefcase = CreatePickup(1210, 1, briefcaseX, briefcaseY, briefcaseZ, 0);
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == mybriefcase)
    {
		ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 777)
	{
        if(response)
        {
            if(listitem ==0)
            {
				if (GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				SetPlayerHealth(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Health for $5000!");
            }
            if(listitem ==1)
            {
				if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -5000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				SetPlayerArmour(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Armour for $5000!"); 
            }
            if(listitem ==2) 
            {
				ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "Weapons", "M4 - 6000$\nAK47 - 6000$\nMP5 - 5000$\nUZI - 10000$\nCombat Shotgun - 10000$\nShotgun - 5000$\nDesert Eagle - 7000$\nSilent Pistol - 3000$\nSniper-8000$\nTec 9 - 3000$\nSawn-Off Shotgun - 8000$\nRPG - 10000$", "Buy", "Exit");
            }
        }
	}
	if(dialogid ==888)
    {
        if(response)
        {
            if(listitem==0) 
            {
				if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -6000); 
				GivePlayerWeapon(playerid, 31, 300);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); 
				SendClientMessage(playerid,COLOR_WHITE, "You bought M4 with 300 Ammo."); 
            }
            if(listitem==1) 
            {
				if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); 
				GivePlayerMoney(playerid, -6000); 
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 30, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought AK 47 with 300 Ammo.");
            }
            if(listitem==2)
            {
				if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -5000);
				GivePlayerWeapon(playerid, 29, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought MP5 with 300 Ammo.");
            }
            if(listitem==3)
            {
				if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -10000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 28, 500);
				SendClientMessage(playerid, COLOR_WHITE, "You bought UZI with 300 Ammo.");
            }
            if(listitem==4)
            {
				if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -10000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 27, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought SPAZ12 with 300 Ammo.");
            }
            if(listitem==5)
            {
				if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -5000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 25, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Shotgun with 300 Ammo.");
            }
            if(listitem==6)
            {
				if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -7000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 24, 100);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Desert Eagle with 100 Ammo.");
            }
            if(listitem==7)
            {
				if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -3000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 23, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Silencer with 300 Ammo.");
            }
            if(listitem==8)
            {
				if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -8000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 34,100);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Sniper with 100 Ammo.");
            }
            if(listitem==9)
            {
				if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -3000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 32, 300);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Tec 9 with 300 Ammo.");
            }
            if(listitem==10)
            {
				if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -8000);
				GivePlayerWeapon(playerid, 26, 100);
				SendClientMessage(playerid, COLOR_WHITE, "You bought Sawn off Shotgun with 100 Ammo.");
            }
            if(listitem==11)
            {
				if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerMoney(playerid, -10000);
				ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel");
				GivePlayerWeapon(playerid, 35, 1);
				SendClientMessage(playerid, COLOR_WHITE, "You bought RPG with 1 Ammo.");
            }
        }
	}
	return 1;
}
Reply
#2

Really good first script, keep up the good work (thumbsup)
Reply
#3

Good work
Reply
#4

1- Thanks for credits, I appreciate it.
2- It's mostly like the tutorial.

Anyway, just a note, to make it dynamic, you need to make like a command /createbriefcase which will create a briefcase and save it's location, that's how it would be dynamic.
Try to update it to that, other than that, good job, and good luck!
Reply
#5

Nice release
Reply
#6

What about me.... You do it have 26 errors.... And i'm fixed all... You just post it and don't have a credits @@...
Reply
#7

This is not really what a dynamic system is.
Reply
#8

Quote:
Originally Posted by JimmyCh
View Post
1- Thanks for credits, I appreciate it.
2- It's mostly like the tutorial.

Anyway, just a note, to make it dynamic, you need to make like a command /createbriefcase which will create a briefcase and save it's location, that's how it would be dynamic.
Try to update it to that, other than that, good job, and good luck!
This is the Tutorial... He doing it awful... I have fixed bugs and add little more details...
Reply
#9

Not bad explaining it, but try to work on the grammar and your spelling.
Reply
#10

@xganyx fixing 26 errors(Which is a missing bracket) is not anything to be mad at, just ask him nicely for credits for helping him.
But I must say you need to actually make it dynamic, this isn't dynamic at all.

DYNAMIC: As in create a briefcase in game, save it to a file and load it if server restarts.. Also give it an ID, which you can create a command to delete afterwards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)