Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ST Paintball
- Copyright © SoomroTayab
- This script is made by SoomroTayab (Goldilox) from scratch.
- Please obey the terms of use.
- TERMS OF USE:
- ø You should not remove this entire comment, it doens't costs you anything.
- ø You can edit it anyway you want.
- ø You shouldn't credit yourself of creating this script.
- ø You can remove my name from entire script such as the prints as long as you keep this whole comment.
- If you experience any bug or something, I can fix it for you. Just reply on the topic, PM me or even email me at [email protected].
- If you are releasing this script, you can also change the hostname if you like to.
- Thanks for downloading.
- */
- #include <a_samp>
- #include <streamer>
- #include <zcmd>
- //Forwards
- forward Money(playerid);
- forward LoadingObjects(playerid);
- forward UnloadingObjects(playerid);
- forward PBCheck();
- //Defines
- #define PBALL 4
- #define PBINFO 5
- #define PB_PLAYERS 6
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_ORANGE 0xFF8000AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GREY 0xCCCCCCAA
- #define COLOR_RED 0xFF0000AA
- new paintball;
- new PBall[MAX_PLAYERS];
- new pblv;
- new Float:PBSpawn[][] =
- {
- {2532.9934,2834.7104,10.8203,183.8086}, // Randomspawn
- {2578.1511,2807.3320,10.8203,303.1663}, // Randomspawn
- {2651.2966,2763.5530,10.8203,1.1102}, // Randomspawn
- {2626.1477,2779.5415,23.8222,128.6146}, // Randomspawn
- {2565.8464,2718.0959,22.9507,308.7598}, // Randomspawn
- {2596.3523,2718.1089,25.8222,339.7568}
- };
- public OnFilterScriptInit()
- {
- pblv = CreateDynamicCP(2633.4612,1721.8558,11.0234,1.0,-1,-1,-1,15.0);
- paintball = CreateDynamicPickup(1239,1,2633.7639,1716.3861,11.0234,-1);
- print("\n--------------------------------------");
- print("Paintball System Loaded - Goldilox (Tayab Soomro)");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PBall[playerid]=0;
- SetTimer("PBCheck",60000,1);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(PBall[playerid] == 1)
- {
- new Random = random(sizeof(PBSpawn));
- SetPlayerInterior(playerid,0);
- GivePlayerWeapon(playerid, 29, 2500);
- SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
- return 1;
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- if(PBall[playerid] == 1)
- {
- new str[128],string[128],name[24],nam[24];
- GetPlayerName(playerid, nam, 24);
- GetPlayerName(killerid, name, 24);
- format(str,sizeof(str),"%s has hunted %s down",name,nam);
- format(string,sizeof(string),"You've been hunted down by %s",name);
- SendClientMessage(playerid,COLOR_RED,string);
- GameTextForPlayer(playerid,"Wonderful!", 3000, 1);
- SetTimer("Money",3200,0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PBall[playerid] == 1)
- {
- SendClientMessage(i,COLOR_ORANGE,str);
- }
- }
- return 1;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == PBALL)
- {
- if(!response) return 1;
- switch (listitem)
- {
- case 0:
- {
- new Random = random(sizeof(PBSpawn));
- if(GetPlayerWantedLevel(playerid) >= 1)return SendClientMessage(playerid,COLOR_GREY,"You're a suspect!");
- SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
- SetPlayerFacingAngle(playerid, PBSpawn[Random][3]);
- SetTimer("LoadingObjects",5000,0);
- GameTextForPlayer(playerid,"Loading Playarea.",4900,5);
- TogglePlayerControllable(playerid,0);
- }
- case 1:
- {
- SendClientMessage(playerid,COLOR_WHITE,"Thanks for using ST Paintball System, this game is developed for entertainment");
- SendClientMessage(playerid,COLOR_WHITE,"of the players around the server. It's perfect for the Freeroam and Role-Playing");
- SendClientMessage(playerid,COLOR_WHITE,"servers. This message is the example informational content you can add to ur script.");
- SendClientMessage(playerid,COLOR_WHITE,"This script is also strong anti paintball abuse, you can't use the paintball weapon");
- SendClientMessage(playerid,COLOR_WHITE,"outside of the paintball. The playing area is completely packed, without any way out,");
- SendClientMessage(playerid,COLOR_WHITE,"except for exiting with a command /paintball. I would appreciate your reputation");
- SendClientMessage(playerid,COLOR_WHITE,"to my account if you're using this script. You are fully permitted to edit the");
- SendClientMessage(playerid,COLOR_WHITE,"script however you like as long as you keep the credits somewhere in the script &");
- SendClientMessage(playerid,COLOR_WHITE,"and consider the fact that I am the creator of this script. Have a nice day!");
- return 1;
- }
- case 3:
- {
- new count = 0;
- new string[128];
- new name1[MAX_PLAYER_NAME];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PBall[i] == 1)
- {
- GetPlayerName(i,name1,MAX_PLAYER_NAME);
- }
- }
- format(string,sizeof(string), "%s", name1);
- ShowPlayerDialog(playerid,PB_PLAYERS,DIALOG_STYLE_MSGBOX,"Current Players",string,"Close","");
- count++;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == pblv)
- {
- ShowPlayerDialog(playerid,PBALL,DIALOG_STYLE_LIST,"Paintball","Play\nInformation\nCurrent Players","Okay","");
- }
- return 1;
- }
- CMD:gotopaintball(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_ORANGE,"You've been teleported to paintball location.");
- SetPlayerPos(playerid,2611.0798,1716.1072,10.8203);
- return 1;
- }
- CMD:paintball(playerid,params[])
- {
- if(PBall[playerid]==0)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 10,2633.7639,1716.3861,11.0234)) return SendClientMessage(playerid,COLOR_GREY,"You're no where close to paintball.");
- new Random = random(sizeof(PBSpawn));
- SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
- SetPlayerFacingAngle(playerid, PBSpawn[Random][3]);
- SetTimer("LoadingObjects",5000,0);
- GameTextForPlayer(playerid,"Loading Playarea...",4900,5);
- TogglePlayerControllable(playerid,0);
- }
- else if(PBall[playerid] == 1)
- {
- SetPlayerPos(playerid,2611.0798,1716.1072,10.8203);
- ResetPlayerWeapons(playerid);
- SetPlayerHealth(playerid,100);
- SetTimer("UnloadingObjects",5000,0);
- TogglePlayerControllable(playerid,0);
- GameTextForPlayer(playerid,"Unloading Playarea...",5000,5);
- }
- return 1;
- }
- public OnPlayerPickUpDynamicPickup(playerid, pickupid)
- {
- if(pickupid == paintball)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Paintball.");
- SendClientMessage(playerid,COLOR_WHITE,"Type /paintball to start paintballing.");
- return 1;
- }
- return 1;
- }
- public Money(playerid)
- {
- GivePlayerMoney(playerid,500);
- GameTextForPlayer(playerid,"~g~+$500",2000,1);
- }
- public LoadingObjects(playerid)
- {
- new name[MAX_PLAYER_NAME],string[128];
- TogglePlayerControllable(playerid,1);
- SendClientMessage(playerid,COLOR_YELLOW,"Type /paintball again in order to stop paintballing.");
- GivePlayerWeapon(playerid, 26, 2500);
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"%s has joined paintball.",name);
- PBall[playerid]=1;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PBall[i] == 1)
- {
- SendClientMessage(i,0x04B4AEAA,string);
- return 1;
- }
- }
- return 1;
- }
- public UnloadingObjects(playerid)
- {
- new name[MAX_PLAYER_NAME],string[128];
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"%s has left paintball.",name);
- PBall[playerid]=0;
- SendClientMessage(playerid,COLOR_WHITE,"Thanks for playing paintball, we hope you come next time!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PBall[i] == 1)
- {
- SendClientMessage(i,0x04B4AEAA,string);
- return 1;
- }
- }
- TogglePlayerControllable(playerid,1);
- return 1;
- }
- public PBCheck()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PBall[i] == 0)
- {
- if(GetPlayerWeapon(i) == 26)
- {
- ResetPlayerWeapons(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment