Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This script was made by Calvin Jones a.k.a Malcom Jones and has mapping's from Calvin
- //Credits to Kush for his SII register system tutorial
- //Credits to Amel_PAtomAXx for the tutorial on how to make chats
- //Credits also goes out to Toni for the ZCMD command tutorial
- // and last credits goes to who ever i didnt mention its either because i forgot your name
- //The script has the following features
- //1:<SII> register/login system 2:<ZCMD> Commands 3:New chat OOC 4:Auto Announcements 5: Gang turfs 6:Speedo meeter
- //7:Anti Spawn Kill
- //======[includes]==================
- #include <a_samp>
- #include <SII>
- #include <sscanf2>
- #include <zcmd>
- //============[Defines]===============
- #define DIALOG_REGISTER 2000
- #define DIALOG_LOGIN 2001
- #define TEAM_BALLAS ( 0 ) // Defines TEAM_BALLAS as team ID 0
- #define TEAM_GROVE ( 1 ) // Defines TEAM_CJ as team ID 1
- #define TEAM_VAGOS (2)
- #define TEAM_VLA (3)
- #define TAKEOVER_TIME 120 // how many seconds needed to take over the zone
- #define MIN_MEMBERS_TO_START_WAR 3 // how many team members needed in a zone to start a war
- #define TAKEOVER_TIME 120 // how many seconds needed to take over the zone
- #define MIN_DEATHS_TO_START_WAR 3 // how many team members must be killed in a zone to start a war
- //==============[colors]=================
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define WHITE "{FFFFFF}"
- #define RED "{F81414}"
- #define GREEN "{00FF22}"
- #define LIGHTBLUE "{00CED1}"
- #define ORANGE "{FFAF00}"
- #define BLUE "{0025E1}"
- #define PURPLE "{FF00FF}"
- //chat colors
- #define COLOR_FADE1 0xFFFFFFFF
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_WHITE 0xFFFFFFFF
- //=====================[forwards]============
- forward SendRandomMsgToAll();
- forward speedometer(playerid); // This Forwards The Timer To Our Function
- forward AntiSpawnKill(playerid);
- //====================[new]===============
- new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
- new Grove;//gang turf
- new Ballas;//gang turfs
- new Vagos;//gang turfs
- new VLA;//gang turfs
- new Float:svx[MAX_PLAYERS]; // Holds Velocity X
- new Float:svy[MAX_PLAYERS]; // Holds Velocity Y
- new Float:svz[MAX_PLAYERS]; // Holds Velocity Z
- new Float:s1[MAX_PLAYERS]; // This Is What Our Forumula Outputs
- new s2[MAX_PLAYERS]; // This Is The Output When The Forumula's Ouput Is Round
- new s3[MAX_PLAYERS][256]; // This Is The Text That Is Displayed To The User
- new Text:sdisplay[MAX_PLAYERS]; // This Holds The Textdraw's ID
- new stimer[MAX_PLAYERS]; // This Holds The Timer's ID (Used To Refresh Speed)
- //=================[enum]===============
- enum pInfo
- {
- pPass,
- pScore,
- pCash,
- pAdmin
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //=====================[stock]=================
- stock getINI(playerid)
- {
- new account[64];
- format(account,30,"Users/%s.ini",gPlayerName[playerid]);
- return account;
- }
- stock strreplace(string[], find, replace)
- {
- for(new i=0; string[i]; i++)
- {
- if(string[i] == find)
- {
- string[i] = replace;
- }
- }
- }
- //======================[Prox]======================
- ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
- {
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- }
- }
- return 1;
- }
- //==========[End of prox]========================================================================
- main()
- {
- print("\n----------------------------------");
- print(" Calvins Gamemode ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Calvins Gamemode");
- SetTimer("SendRandomMsgToAll", 60 * 1000, 1);
- //Ballas-weapons start behind float a //FLOAT A /wep 1 /wep 2 /wep 3
- AddPlayerClass(102, 2002.281616, -1123.249633, 26.577611, 269.1425, 5, 150, 28, 150, 24, 150);
- AddPlayerClass(103, 2002.281616, -1123.249633, 26.577611, 269.1425, 27, 150, 29, 150, 31, 150);
- AddPlayerClass(104, 2002.281616, -1123.249633, 26.577611, 269.1425, 24, 150, 32, 150, 27, 150);
- //Grove
- AddPlayerClass(105, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 29, 150, 27, 150);
- AddPlayerClass(106, 2478.777832, -1661.156738, 13.343750, 269.1425, 22, 150, 28, 150, 30, 150);
- AddPlayerClass(107, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 28, 150, 31, 150);
- AddPlayerClass(270, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 32, 150, 33, 150);
- AddPlayerClass(271, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 28, 150, 34, 150);
- AddPlayerClass(269, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 32, 150, 26, 150);
- //vagos
- AddPlayerClass(108, 1882.914916, -2040.028686, 13.390607, 269.1425, 22, 150, 28, 150, 30, 150);
- AddPlayerClass(109, 1882.914916, -2040.028686, 13.390607, 269.1425, 23, 150, 29, 150, 31, 150);
- AddPlayerClass(110, 1882.914916, -2040.028686, 13.390607, 269.1425, 24, 150, 32, 150, 27, 150);
- //CJ
- //AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- //Los Aztecas
- AddPlayerClass(114, 2785.370361, -1994.306518, 13.382812, 269.1425, 22, 150, 28, 150, 30, 150);
- AddPlayerClass(115, 2785.370361, -1994.306518, 13.382812, 269.1425, 23, 150, 29, 150, 31, 150);
- AddPlayerClass(116, 2785.370361, -1994.306518, 13.382812, 269.1425, 24, 150, 32, 150, 27, 150);
- //Vehicles
- AddStaticVehicleEx(566,2007.69995117,-1131.00000000,25.00000000,87.99499512,85,1,15); //Tahoma
- AddStaticVehicleEx(566,1994.80004883,-1131.19995117,25.39999962,89.99401855,85,1,15); //Tahoma
- AddStaticVehicleEx(522,1998.00000000,-1116.00000000,26.39999962,0.00000000,85,1,15); //NRG-500
- AddStaticVehicleEx(522,1993.69995117,-1115.90002441,26.39999962,0.00000000,85,1,15); //NRG-500
- AddStaticVehicleEx(522,1995.69995117,-1116.00000000,26.39999962,0.00000000,85,1,15); //NRG-500
- AddStaticVehicleEx(567,2004.40002441,-1120.59997559,26.60000038,179.99963379,85,1,15); //Savanna
- AddStaticVehicleEx(492,2508.69995117,-1669.00000000,13.30000019,0.00000000,16,1,15); //Greenwood
- AddStaticVehicleEx(522,2507.89990234,-1687.09997559,13.19999981,0.00000000,16,1,15); //NRG-500
- AddStaticVehicleEx(522,2506.00000000,-1686.90002441,13.19999981,0.00000000,16,1,15); //NRG-500
- AddStaticVehicleEx(522,2503.89990234,-1687.00000000,13.19999981,0.00000000,16,1,15); //NRG-500
- AddStaticVehicleEx(600,2473.60009766,-1690.40002441,13.39999962,0.00000000,16,1,15); //Picador
- AddStaticVehicleEx(550,2502.80004883,-1657.80004883,13.30000019,54.00000000,16,1,15); //Sunrise
- AddStaticVehicleEx(550,2492.00000000,-1682.80004883,13.30000019,89.99780273,16,1,15); //Sunrise
- AddStaticVehicleEx(550,2483.39990234,-1682.40002441,13.30000019,83.99450684,16,1,15); //Sunrise
- AddStaticVehicleEx(550,2484.60009766,-1655.19995117,13.19999981,89.99450684,16,1,15); //Sunrise
- AddStaticVehicleEx(509,2763.19995117,-2006.59997559,13.19999981,0.00000000,100,1,15); //Bike
- AddStaticVehicleEx(522,2767.50000000,-2006.69995117,13.19999981,0.00000000,2,1,15); //NRG-500
- AddStaticVehicleEx(522,2769.10009766,-2006.59997559,13.19999981,0.00000000,2,1,15); //NRG-500
- AddStaticVehicleEx(522,2770.50000000,-2006.40002441,13.19999981,0.00000000,2,1,15); //NRG-500
- AddStaticVehicleEx(522,2771.80004883,-2006.30004883,13.19999981,0.00000000,2,1,15); //NRG-500
- AddStaticVehicleEx(475,2764.60009766,-1983.00000000,13.30000019,0.00000000,2,1,15); //Sabre
- AddStaticVehicleEx(475,2764.30004883,-1975.69995117,13.39999962,0.00000000,2,1,15); //Sabre
- AddStaticVehicleEx(509,2763.39990234,-2011.69995117,13.19999981,0.00000000,100,1,15); //Bike
- AddStaticVehicleEx(567,2774.69995117,-1967.50000000,13.50000000,0.00000000,2,1,15); //Savanna
- AddStaticVehicleEx(575,2764.30004883,-1968.40002441,13.30000019,0.00000000,2,2,15); //Broadway
- AddStaticVehicleEx(575,2774.80004883,-1974.50000000,13.30000019,0.00000000,2,2,15); //Broadway
- AddStaticVehicleEx(567,2774.69995117,-1958.50000000,13.50000000,0.00000000,2,1,15); //Savanna
- AddStaticVehicleEx(536,2764.19995117,-1960.59997559,13.39999962,0.00000000,2,1,15); //Blade
- AddStaticVehicleEx(576,1878.09997559,-2021.90002441,13.10000038,182.00000000,6,1,15); //Tornado
- AddStaticVehicleEx(482,1878.09997559,-2028.69995117,13.60000038,177.99963379,6,1,15); //Burrito
- AddStaticVehicleEx(522,1886.40002441,-2014.69995117,13.19999981,181.99963379,6,1,15); //NRG-500
- AddStaticVehicleEx(522,1884.80004883,-2014.90002441,13.19999981,181.99951172,6,1,15); //NRG-500
- AddStaticVehicleEx(522,1883.09997559,-2015.00000000,13.19999981,181.99951172,6,1,15); //NRG-500
- AddStaticVehicleEx(522,1881.00000000,-2015.19995117,13.19999981,181.99951172,6,1,15); //NRG-500
- AddStaticVehicleEx(576,1888.09997559,-2021.30004883,13.30000019,181.99951172,6,1,15); //Tornado
- AddStaticVehicleEx(482,1888.00000000,-2027.90002441,13.60000038,177.99499512,6,1,15); //Burrito
- AddStaticVehicleEx(467,1878.00000000,-2035.50000000,13.39999962,179.99963379,6,1,15); //Oceanic
- AddStaticVehicleEx(467,1887.69995117,-2034.59997559,13.30000019,179.99450684,6,1,15); //Oceanic
- //Objects start here
- CreateObject(1432,2785.80004883,-1995.09997559,12.39999962,0.00000000,0.00000000,0.00000000); //object(dyn_table_2) (1)
- CreateObject(1766,2782.30004883,-1991.59997559,12.39999962,0.00000000,0.00000000,0.00000000); //object(med_couch_1) (1)
- CreateObject(2370,2782.69995117,-1994.40002441,12.39999962,0.00000000,0.00000000,0.00000000); //object(shop_set_1_table) (1)
- CreateObject(1487,2782.60009766,-1993.59997559,13.39999962,0.00000000,0.00000000,0.00000000); //object(dyn_wine_1) (1)
- CreateObject(1487,2782.89990234,-1994.19995117,13.39999962,0.00000000,0.00000000,0.00000000); //object(dyn_wine_1) (2)
- CreateObject(1487,2785.60009766,-1995.00000000,13.19999981,0.00000000,0.00000000,0.00000000); //object(dyn_wine_1) (3)
- CreateObject(1665,2783.39990234,-1993.69995117,13.30000019,0.00000000,0.00000000,0.00000000); //object(propashtray1) (1)
- CreateObject(3044,2783.39990234,-1993.59997559,13.39999962,0.00000000,0.00000000,0.00000000); //object(cigar) (1)
- CreateObject(1766,2780.50000000,-1993.80004883,12.39999962,0.00000000,0.00000000,90.00000000); //object(med_couch_1) (2)
- //gang turfs
- Grove = GangZoneCreate(2417.757, -1729.235, 2619.307, -1614.75);
- Ballas = GangZoneCreate(1858.74, -1259.454, 2064.094, -1125.23);
- Vagos = GangZoneCreate(1820.712, -2179.277, 1969.022, -1977.943);
- VLA = GangZoneCreate(2699.167, -2056.897, 2786.632, -1898.988);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public SendRandomMsgToAll()
- {
- switch(random(4))// "switch - case" is a sort of "if - else if - else" statement (operator?)
- {
- case 0: SendClientMessageToAll(0x00ff00ff, "Hi welcome to the server"); //Case means "if ( The function from switch() ) equals '0' (In this case)."
- case 1: SendClientMessageToAll(0x00ff00ff, "Did you know Calvin created the server when he was learning to script?");
- case 2: SendClientMessageToAll(0x00ff00ff, "If you get caught Hacking you will get banned.");
- case 3: SendClientMessageToAll(0x00ff00ff, "This is a TDM/DM script.");
- case 4: SendClientMessageToAll(0x00ff00ff, "If you spot a rule breaker /report.");
- }
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 2201.6306,1217.2319,10.8128);
- SetPlayerFacingAngle(playerid,178.6062);
- SetPlayerCameraPos(playerid, 2202.2537,1210.6444,10.8128);
- SetPlayerCameraLookAt(playerid, 2201.6306,1217.2319,10.8128);
- switch ( classid ) // This is like a if/elseif statement.
- {
- case 0: // If the classid is 0
- { // Then
- GameTextForPlayer( playerid, "~p~Glen Park Ballas", 300, 3 );
- // Sends a gametext for player
- // ~r~ is a red color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_BALLAS ); // Sets the player's team to TEAM_BALLAS
- }
- case 1: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~p~Glen Park Ballas", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_BALLAS ); // Sets the player's team to TEAM_Grove
- }
- case 2: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~p~Glen Park Ballas", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_BALLAS); // Sets the player's team to TEAM_Grove
- }
- case 3: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 4: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 5: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 6: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 7: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 8: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~g~Grove Street", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_GROVE ); // Sets the player's team to TEAM_Grove
- }
- case 9: // If the classid is 1
- { // Then
- GameTextForPlayer( playerid, "~y~LS Vagos", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VAGOS ); // Sets the player's team to TEAM_Grove
- }
- case 10: // If the classid is 2
- { // Then
- GameTextForPlayer( playerid, "~y~LS Vagos", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VAGOS ); // Sets the player's team to TEAM_Vagos
- }
- case 11: // If the classid is 2
- { // Then
- GameTextForPlayer( playerid, "~y~LS Vagos", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VAGOS ); // Sets the player's team to TEAM_Vagos
- }
- case 12: // If the classid is 2
- { // Then
- GameTextForPlayer( playerid, "~b~Los Aztecas", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VLA ); // Sets the player's team to TEAM_Vagos
- }
- case 13: // If the classid is 2
- {
- GameTextForPlayer( playerid, "~b~Los Aztecas", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VLA ); // Sets the player's team to TEAM_Vagos
- }
- case 14: // If the classid is 2
- { // Then
- GameTextForPlayer( playerid, "~b~Los Aztecas", 300, 3 );
- // Sends a gametext for player
- // ~g~ is a green color in gametext.
- // Arguments : Player ID, const string[ ], time ( milliseconds ), style
- // Wiki for more info
- SetPlayerTeam( playerid, TEAM_VLA ); // Sets the player's team to TEAM_Vagos
- }
- }
- return 1; // This means the callback is executed succesfully AFAIK.
- }
- public speedometer(playerid) {
- GetVehicleVelocity(GetPlayerVehicleID(playerid), svx[playerid], svy[playerid], svz[playerid]); // This Saves Our Velocitys To Our Varibles
- s1[playerid] = floatsqroot(((svx[playerid]*svx[playerid])+(svy[playerid]*svy[playerid]))+(svz[playerid]*svz[playerid]))*100; // This Is Our Forumula ( I Don't Know How It Works )
- s2[playerid] = floatround(s1[playerid],floatround_round); // This Rounds Our Output To The Nearest Whole Number
- format(s3[playerid],256,"%i MPH", s2[playerid]); // This Format Our Text Into What We See
- TextDrawSetString(sdisplay[playerid], s3[playerid]); // This Changes The Value Of Our Textdraw To What We Formatted
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- sdisplay[playerid] = TextDrawCreate(10.0,200.0," "); // This Creates Our Textdraw And Stores The Id In The Varible In Front
- TextDrawSetShadow(sdisplay[playerid],0); // This Removes Our Textdraw's Shadow ( Makes Easier To Read )
- TextDrawSetOutline(sdisplay[playerid],1); // This Adds A Black Outline To Our Textdraw ( Makes Easier To Read )
- TextDrawFont(sdisplay[playerid], 2); // This Changes Our Textdraw's Font ( I Think This Ones Makes It Easier To Read )
- TextDrawShowForPlayer(playerid,sdisplay[playerid]); // This Shows The User The Textdraw
- GameTextForPlayer(playerid,"~w~SA-MP: ~r~Calvins TDM Script",5000,5);
- GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
- if (fexist(getINI(playerid)))
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""WHITE"Registering...",""WHITE"Type your password below to register a new account.","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public AntiSpawnKill(playerid)
- {
- SetPlayerHealth(playerid,100.0);
- SendClientMessage(playerid,COLOR_GREY,"AntiSpawnKill is now off you have 100 life now!");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerHealth(playerid,99999);
- SetTimerEx("AntiSpawnKill",6000,0,"i",playerid);
- GangZoneShowForPlayer(playerid, Grove, 0x0080005F);
- GangZoneShowForPlayer(playerid, Ballas, 0x40008096);
- GangZoneShowForPlayer(playerid, Vagos, 0xFFFF0096);
- GangZoneShowForPlayer(playerid, VLA, 0x00FFFF96);
- return 1;
- }
- public OnPlayerDeath( playerid, killerid, reason ) // This is called when a player deaths.
- {
- if ( killerid != INVALID_PLAYER_ID ) // If the killerid are NOT an invalid player
- { // Then
- if ( GetPlayerTeam( killerid ) == GetPlayerTeam( playerid ) ) // If killerid's team == playerid's team ( who has been killed )
- { // Then
- SetPlayerHealth( killerid, -1 ); // Kills the killer ( Setting the health to -1 ).
- SendClientMessage( killerid, -1, "No teamkilling." ); // Sends a message to the killer with a white colour ( -1 ), with the message " No teamkilling. ".
- GivePlayerMoney( killerid, - 5000 ); // Take $5000 from the killerid, because teamkilling,
- }
- else // Another team killed the player
- {
- SendClientMessage( killerid, -1, "Nice shot!" ); // Sends a message to the killer with a white colour ( -1 ) with the message "Nice Shot! ".
- GivePlayerMoney( killerid, 5000 ); // Gives the killerid $5000.
- }
- }
- SendDeathMessage( killerid, playerid, reason ); // Sends a death message about the killerid is killing the player, with the reason ( At the middle right of your game, can be toggled by pressing F9 ).
- return 1; // This means the callback is executed succesfully AFAIK.
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new pname[MAX_PLAYER_NAME], str[128];//reduce it if you want
- GetPlayerName(playerid, pname, sizeof(pname));
- strreplace(pname, '_', ' ');
- format(str, sizeof(str), "%s says: %s", pname, text);//Appearance of the text submitted by a nearby player.
- /*
- * The first parameter states the radius of the area where the text will be submitted and if a player is inside the radius, the person will receive it.
- * The second parameter is the player that is submitting the text.
- * The third parameter will specify what exactly the text is, in this case %speaker says: %text.
- * The rest of the parameters are the fading colors, where how far the receiver is far from the talker.
- */
- ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- return 0;//So that the text is not submitted regularly.
- }
- COMMAND:ooc(playerid, params[])
- {
- new sendername[MAX_PLAYER_NAME], string[128];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strreplace(sendername, '_', ' ');
- format(string, sizeof(string), "(( %s: %s ))", sendername, params);
- SendClientMessageToAll(COLOR_WHITE, string);
- return 1;
- }
- COMMAND:info(playerid, params)
- {
- SendClientMessage(playerid, COLOR_GREY,"/Report /adminhelp /pmhelp /Weaponhelp /kill");
- SendClientMessage(playerid, COLOR_GREY,"This is the beginning commands");
- return 1;
- }
- COMMAND:weaponhelp(playerid, params)
- {
- SendClientMessage(playerid, COLOR_GREY,"To buy weapons go to any ammunation in Los Santos.");
- return 1;
- }
- COMMAND:kill(playerid, params)
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- COMMAND:pmhelp(playerid, params)
- {
- SendClientMessage(playerid, COLOR_GREY,"To PM(private message) a player use /pm");
- return 1;
- }
- COMMAND:adminhelp(playerid, params)
- {
- SendClientMessage(playerid, COLOR_GREY,"Level 1 Admin /kick /godmodeon /godmodeoff /teleport /goto /kick");
- SendClientMessage(playerid, COLOR_GREY,"Next admin level coming soon!");
- return 1;
- }
- COMMAND:godmodeon(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SetPlayerHealth(playerid, 10000000);
- SetPlayerArmour(playerid, 10000000);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- COMMAND:pm(playerid, params[])
- {
- new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
- if(sscanf(params, "us", id, str2))
- {
- SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
- return 1;
- }
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
- {
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
- SendClientMessage(id, 0xFF0000FF, str);
- }
- return 1;
- }
- COMMAND:godmodeoff(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- COMMAND:teleport(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new ID;
- if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /tele [playerid]");
- else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(ID, x+1, y+1, z);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- COMMAND:goto(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new ID;
- if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
- else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(ID, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- COMMAND:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new PID, pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
- if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid]");
- if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- new Str[128];
- GetPlayerName(PID, pName, sizeof(pName));
- GetPlayerName(playerid, Sender, sizeof(Sender));
- format(Str, sizeof(Str), "You kicked %s!", pName);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, Str);
- Kick(PID);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- COMMAND:makemeadmin(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- PlayerInfo[playerid][pAdmin] = 1;
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have made yourself an Admin!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate) { // This Is The Callback That Is Called When A Person Changes State ( ex States In_Vehicle, Dead, Passenger, Speculating... )
- KillTimer(stimer[playerid]); // This Stops Our Timer For When You Get Out Of Your Vehicle Your Speed Doesn't Keep Going
- TextDrawSetString(sdisplay[playerid], " "); // This Sets Our Textdraw To Blank And Freezes Because We Stop The Timer ^
- if(newstate == 2) stimer[playerid] = SetTimerEx("speedometer", 255, true, "i", playerid); // This Starts The Timer When The Player Changes His/Her State To Being The Driver
- else if(newstate == 3) stimer[playerid] = SetTimerEx("speedometer", 250, true, "i", playerid); // This Start The Timer When The Player Changes His/Her Start To Being The Passenger
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if (response)
- {
- if(!strlen(inputtext)) {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
- }
- if(INI_Open(getINI(playerid))) {
- INI_WriteString("Password",inputtext);
- INI_WriteInt("Score",1);
- INI_WriteInt("Cash",5000);
- INI_WriteInt("Admin",0);
- INI_Save();
- INI_Close();
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
- }
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(!strlen(inputtext)) {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
- }
- if(INI_Open(getINI(playerid))) {
- INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
- if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
- }
- SetPlayerScore( playerid, INI_ReadInt("Score" ) );
- ResetPlayerMoney( playerid );
- GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
- PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
- INI_Close();
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment