// The entry pickup new AmmuPickupEntry; // The exit pickup new AmmuPickupExit; public OnGameModeInit() { // 1318 is the pickup model ID, followed by the coordinates in the world AmmuPickupEntry = CreatePickup(1318, 1, 1367.8782, -1279.7295, 13.5469); // And this is the exit pickup that exists inside the store AmmuPickupExit = CreatePickup(1318, 1, 285.3757, -41.3928, 1001.5156); }
You'll need to go to OnPlayerPickUpPickUp } if(pickupid == ammupickupentry)//LS Enter ammu market the pickup that we've created { SetPlayerPos(playerid, 286.1017,-41.8042, 1001.5156);// if the player stand on it he gets teleported to ammu coord SetPlayerInterior ( playerid, 1 );// and we set him into ammu-natioin id you can get both of this in http://weedarr.wikidot.com/interior } if(pickupid == ammuoutpickupexit)//LS exit ammu market the exit pickup that we've created { SetPlayerPos(playerid, 1364.8909,-1279.5602,13.5469);// if the player stand on it he gets teleported to out of ammu you can teleport him the place that you want by /save <text> SetPlayerInterior (playerid, 0);// here we get the player out of interior by setting his interior to 0 }
We will have to add new ammuCP;// you can add it before ongamemodeinit Now we go to the ammu-nation type /save in the place that we want to put the Checkpoint After that we go to OnGamodeinit ammuCP= CreateDynamicCP(296.6336,-38.0615,1001.5156,2,-1,-1,-1);// now we've created the cp Just put your X,y,z dont touch anything else After that go to your dialog defines! type #Define DIALOG_AMMU 788// if you have this in your gamemode so change it to another id After that go to OnPlayerEnterDynamicCP } if(checkpointid == ammuCP)// now we will create what happens if player enter this checkpoint dialog will appear i've just added few Weapons you can add what you want { format(str, 956, "Sawn-off\nCombat Shotgun.nMicro SMG\nMP5\nAK47\nM4\nTec9\nSniper Rifle\nDetonator\nDesert Eagle\nBody Armour\nMinigun\n"); ShowPlayerDialog(playerid, DIALOG_AMMU, DIALOG_STYLE_LIST, "{FF0000}Ammu-Nation", str, "Confirm", ".: Close :."); } The Pickups is done also the Checkpoint also the Dialog
if(dialogid == DIALOG_AMMU) { if(response) { if(listitem == 0)// Sawn-off { if(GetPlayerMoney(playerid) < 12000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!");// We will check if the player have 12k to buy sawn-off if he dont have, we will send him message! that he cant buy it GivePlayerWeapon(playerid, 26, 100);// this function is used to giveplayerweapon(playerid, 26 is the weapon id, 100 is the ammo GivePlayerMoney(playerid, -12000);// now we will take from the player 12k GameTextForPlayer(playerid,"~r~-12000~g~$",5000,1);// this is a gametext for player will appear when he buy sawn-off SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Sawnoff Shotgun");//a message will appear } if(listitem == 1)//Combat Shotgun { if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 27, 50); GivePlayerMoney(playerid, -10000); GameTextForPlayer(playerid,"~r~-10000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Combat Shotgun"); } if(listitem == 2)//Micro SMG { if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 28, 400); GivePlayerMoney(playerid, -6000); GameTextForPlayer(playerid,"~r~-6000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Micro SMG"); } if(listitem == 3)//MP5 { if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 29, 300); GivePlayerMoney(playerid, -15000); GameTextForPlayer(playerid,"~r~-15000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: MP5"); } if(listitem == 4)// M4 { if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 30, 600); GivePlayerMoney(playerid, -20000); GameTextForPlayer(playerid,"~r~-20000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: M4"); } if(listitem == 5)//tec9 { if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 32, 500); GivePlayerMoney(playerid, -4000); GameTextForPlayer(playerid,"~r~-4000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Tec9"); } if(listitem == 6)//Sniper Rifle { if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 34, 100); GivePlayerMoney(playerid, -15000); GameTextForPlayer(playerid,"~r~-15000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Sniper Rifle"); } if(listitem == 7)//Detonator { if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 40, 5); GivePlayerMoney(playerid, -25000); GameTextForPlayer(playerid,"~r~-25000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Detonator"); } if(listitem == 8)//Desert eagle { if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 24, 300); GivePlayerMoney(playerid, -20000); GameTextForPlayer(playerid,"~r~-25000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Desert Eagle"); } if(listitem == 9)//body armour { if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); SetPlayerArmour(playerid, 100); GameTextForPlayer(playerid,"~r~-2000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought: Body Armour"); } if(listitem == 10)//Minigun { if(GetPlayerMoney(playerid) < 150000) return SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF} You don't have enough money!"); GivePlayerWeapon(playerid, 38, 20); GivePlayerMoney(playerid, -150000); GameTextForPlayer(playerid,"~r~-150000~g~$",5000,1); SendClientMessage(playerid, 0x22B998AA,"You Bought Weapon: Minigun"); return 1; } } }
/* pls comment me*/
also, work on your text indentation because your code looks a little bit like spaghetti and is definitely not a good example for beginners |
I'll work on that sorry also i am a beginner scripter too i've been learnning pawn scripts 2 months ago
|
If you don't know what you're doing, don't write a tutorial about it
|