01.10.2013, 18:34
(
Last edited by Nofear192; 15/10/2013 at 04:45 PM.
)
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:
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!
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; }