Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <streamer>
- #include <foreach>
- CMD:bounty(playerid, params[])
- {
- new msg[136], bountyid, bountycashh;
- if(sscanf(params, "ii", bountyid, bountycashh)) return SendClientMessage(playerid, ERRORCOLOR, "Usage:/bounty [id] [amount]");
- if(!IsPlayerConnected(bountyid)) return SendClientMessage(playerid, ERRORCOLOR, "Invalid playerid");
- if(GetPlayerMoney(playerid) < bountycashh || GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, ERRORCOLOR, "invaild amount");
- SetPlayerMoney(playerid, GetPlayerMoney(playerid) - bountycashh);
- bountiable[bountyid] = 1;
- bountycash[bountyid] = bountycashh;
- format(msg, sizeof(msg), "%s has set a bounty $%d on %s's head", Name[playerid] ,bountycashh, Name[bountyid]);
- SendClientMessageToAll(ERRORCOLOR, msg);
- return 1;
- }
- CMD:pubg(playerid, params[])
- {
- new pubgid, msg[123];
- if (CommandCheck(playerid, "pubg")) return 0;
- if (sscanf(params, "i", pubgid)) return SendClientMessage(playerid, ERRORCOLOR, "Usage: /pubg [1-4]");
- if (pubgid < 1 || pubgid > 4) return SendClientMessage(playerid, ERRORCOLOR, "invaild pubg name");
- if (inpubg[playerid] == 1) return SendClientMessage(playerid, ERRORCOLOR, "You are already in pubg");
- if (pubgsignedup[playerid] == 1) return SendClientMessage(playerid, ERRORCOLOR, "You have already signed up");
- if (pubg1running == 1) return SendClientMessage(playerid, ERRORCOLOR, "pubg 1 is already running , please wait a little.");
- if (pubgid == 1 && timerrunning == 0)
- {
- SetTimer("pubgpreperation", 12000, false);
- printf("pass 1");
- pubgsignedup[playerid] = 1;
- pubgplayers += 1;
- SendClientMessageToAll(0x91FF00FF, "Pubg 1 starts in 20 seconds , use {FF0000}(/pubg 1){91FF00} to join");
- format(msg, sizeof(msg), "{D4B790}%s has signed up for pubg 1. {FF0000}(/pubg 1)", Name[playerid]);
- SendClientMessageToAll(-1, msg);
- timerrunning = 1;
- }
- else if (pubgid == 1 && timerrunning == 1)
- {
- pubgsignedup[playerid] = 1;
- pubgplayers += 1;
- format(msg, sizeof(msg), "{D4B790}%s has signed up for pubg 1. {FF0000}(/pubg 1)", Name[playerid]);
- SendClientMessageToAll(-1, msg);
- }
- else if (pubgid == 2 || pubgid == 3 || pubgid == 4) return SendClientMessage(playerid, ERRORCOLOR, "The pubg id you had chosen is currently under maintance , please try again later");
- return 1;
- }
- CMD:pickup(playerid, params[])
- {
- if (inpubg[playerid] != 1) return SendClientMessage(playerid, ERRORCOLOR, "You may only use this command while in a game");
- if (abiltopick[playerid] == 0) return SendClientMessage(playerid, ERRORCOLOR, "Please wait 20 seconds before picking up the next weapon");
- if (IsPlayerInRangeOfPoint(playerid, 3,-992.2407,-1062.1375,129.2188))
- {
- GivePlayerWeapon(playerid, 23, 120);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-1049.3972,-1244.6392,128.4763))
- {
- GivePlayerWeapon(playerid, 9, 1);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-1161.2699,-1278.1047,154.5398))
- {
- GivePlayerWeapon(playerid, 34, 20);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-964.2363,-970.6340,131.9541))
- {
- GivePlayerWeapon(playerid, 27, 450);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-1172.9540,-985.1346,131.5091))
- {
- GivePlayerWeapon(playerid, 33, 35);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-1131.6649,-1084.4207,129.2188))
- {
- GivePlayerWeapon(playerid, 25, 100);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else if (IsPlayerInRangeOfPoint(playerid, 3,-994.1649,-1112.0087,132.2200))
- {
- GivePlayerWeapon(playerid, 31, 200);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- abiltopick[playerid] = 0;
- SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
- }
- else return SendClientMessage(playerid, ERRORCOLOR, "You are not in range of any pickable item");
- return 1;
- }
- forward pickupcooldown(playerid);
- public pickupcooldown(playerid)
- {
- abiltopick[playerid] = 1;
- }
- CMD:pubgcancel(playerid, params[])
- {
- new msg[121];
- if (pubgsignedup[playerid] != 1) return SendClientMessage(playerid, ERRORCOLOR, "You didn't signedup to any pubg game yet");
- else
- {
- pubgplayers -= 1;
- pubgsignedup[playerid] = 0;
- format(msg, sizeof(msg), "{D4B790}%s has canceled sign'ion for pubg 1.{D4B790}", Name[playerid]);
- SendClientMessageToAll(-1, msg);
- }
- return 1;
- }
- forward pubgpreperation();
- public pubgpreperation()
- {
- new ppubg1start;
- ppubg1start = SetTimer("pubgstartup", 18000, false);
- if(pubgplayers < 2)
- {
- SendClientMessageToAll(ERRORCOLOR, "Pubg 1 had been canceled due to less players , 3 players required");
- KillTimer(ppubg1start);
- timerrunning = 0;
- pubgplayers = 0;
- foreach (new i : Character)
- {
- if(pubgsignedup[i] == 1)
- {
- pubgsignedup[i] = 0;
- }
- else if(inpubg[i] == 1)
- {
- inpubg[i] = 0;
- }
- }
- }
- printf("pass 2");
- return 1;
- }
- forward pubgstartup();
- public pubgstartup()
- {
- new Random;
- foreach(new i : Character)
- {
- if(pubgsignedup[i] == 1 && !IsPlayerNPC(i))
- {
- posstate_{i} = 12;
- Random = random(sizeof(pubg));
- SetPlayerPos(i, pubg[Random][0], pubg[Random][1], pubg[Random][2]);
- SetPlayerFacingAngle(i, pubg[Random][3]);
- SetPlayerVirtualWorld(i, 12);
- pubg1running = 1;
- pubgsignedup[i] = 0;
- ResetPlayerWeapons(i);
- SetPlayerArmour(i, 0);
- SetPlayerHealth(i, 70);
- GivePlayerWeapon(i, 25, 7);
- GivePlayerWeapon(i, 6, 1);
- SendClientMessage(i, 0xFF2121FF, "Note: c-bug is disabled while in a game!.");
- inpubg[i] = 1;
- abiltopick[i] = 1;
- SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} You are now in a forest !, you have to survive to be the winner!");
- SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} There is some pickups around the map , pickup them to help you !");
- SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} Good luck hunter !");
- TogglePlayerControllable(i, 0);
- timerrunning = 0;
- counter = 6;
- printf("pubg startup : %d" , i);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(reason != 49 || reason != 50 || reason != 51 || reason != 0)
- {
- if(bountiable[playerid] == 1 && posstate_{playerid} == 0 && bountycash[playerid] != 0)
- {
- bountiable[playerid] = 0;
- GivePlayerMoney(killerid, bountycash[playerid]);
- format(msg, sizeof(msg), "%s has killed %s and taken %d", Name[killerid], Name[playerid], bountycash[playerid]);
- SendClientMessageToAll(ERRORCOLOR, msg);
- bountycash[playerid] = 0;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement