Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new gTeam[MAX_PLAYERS];
- new Text:S_Kills;
- new SKill;
- new RKill;
- #define ServerName "Future Christmas Wars (2)"
- #define TOWIN 25
- #define D_SELECT 1337
- #define T_SANTA 0
- #define T_ROBBER 1
- forward SpawnEx(playerid);
- main()
- {
- print("\n----------------------------------");
- print(""ServerName" Loaded!");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("CW By Kitten");
- SendRconCommand("hostname "ServerName"");
- CreateMapObjects();
- CreateTextdraws();
- SetWorldTime(0);
- SetWeather(2);
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawHideForAll(S_Kills);
- TextDrawDestroy(S_Kills);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ShowPlayerDialog(playerid,D_SELECT,DIALOG_STYLE_MSGBOX,"Select your team!","Select between Santa team or Robber Team!","Santa","Robber");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- RemovePlayerAttachedObject(playerid,5);
- SetPlayerAttachedObject(playerid, 5, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
- if(gTeam[playerid] == T_SANTA)
- {
- SetPlayerPos(playerid,-1968.8000488281,1617.8000488281,66.699996948242);
- GivePlayerWeapon(playerid,24,35);
- GivePlayerWeapon(playerid,29,150);
- SetPlayerColor(playerid,0xAA333355);
- SetPlayerTeam(playerid,T_SANTA);
- SetPlayerSkin(playerid,264);
- SendClientMessage(playerid,-1,"[SERVER] Protect the presents, terminate the robbers!");
- }
- if(gTeam[playerid] == T_ROBBER)
- {
- SetPlayerPos(playerid,-1778.3000488281,1618.3000488281,68.599998474121);
- GivePlayerWeapon(playerid,24,35);
- GivePlayerWeapon(playerid,28,150);
- SetPlayerColor(playerid,0x0000BB55);
- SetPlayerTeam(playerid,T_ROBBER);
- SetPlayerSkin(playerid,24);
- SendClientMessage(playerid,-1,"[SERVER] Terminate santa, steal presents!");
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(gTeam[killerid] == T_SANTA) SKill++;
- if(gTeam[killerid] == T_SANTA) RKill++;
- new str[64];
- format(str,sizeof(str),"~r~Evil Santa Kills~w~: %i~n~~g~Stealer Kills~w~: %i",SKill,RKill);
- TextDrawSetString(S_Kills,str);
- if(SKill >= TOWIN)
- {
- SendClientMessage(playerid,-1,"[SERVER] Santa have saved christmas!");
- SendClientMessage(playerid,-1,"[SERVER] New round starting!");
- SKill = 0;
- RKill = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerHealth(i,0.0);
- }
- }
- if(RKill >= TOWIN)
- {
- SendClientMessage(playerid,-1,"[SERVER] Christmas has been ruined presents were stolen!");
- SendClientMessage(playerid,-1,"[SERVER] New round starting!");
- SKill = 0;
- RKill = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerHealth(i,0.0);
- }
- }
- if(SKill == TOWIN)
- {
- SendClientMessage(playerid,-1,"[SERVER] Half of the presents were stolen still christmas isn't ruined!");
- SendClientMessage(playerid,-1,"[SERVER] New round starting!");
- SKill = 0;
- RKill = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerHealth(i,0.0);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case D_SELECT:
- {
- if(response) gTeam[playerid] = T_SANTA,SetTimerEx("SpawnEx", 400, false, "playerid", playerid),TextDrawShowForPlayer(playerid,S_Kills);
- if(!response) gTeam[playerid] = T_ROBBER,SetTimerEx("SpawnEx", 400, false, "playerid", playerid),TextDrawShowForPlayer(playerid,S_Kills);
- }
- }
- return 1;
- }
- public SpawnEx(playerid) return SpawnPlayer(playerid);
- public OnPlayerUpdate(playerid)
- {
- switch(GetPlayerWeapon(playerid))
- {
- case 1,2,3,9,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
- {
- SendClientMessage(playerid,-1,"[KICKED] We do not allow cheating in this server!");
- Kick(playerid);
- }
- }
- if(IsPlayerInWater(playerid))
- {
- SetPlayerHealth(playerid,0.0);
- }
- return 1;
- }
- stock CreateTextdraws()
- {
- S_Kills = TextDrawCreate(496.000000, 122.000000, "~r~Santa Kills~w~: 0~n~~g~Stealer Kills~w~: 0");
- TextDrawBackgroundColor(S_Kills, 255);
- TextDrawFont(S_Kills, 1);
- TextDrawLetterSize(S_Kills, 0.490000, 2.300000);
- TextDrawColor(S_Kills, -1);
- TextDrawSetOutline(S_Kills, 0);
- TextDrawSetProportional(S_Kills, 1);
- TextDrawSetShadow(S_Kills, 1);
- return 1;
- }
- stock CreateMapObjects()
- {
- CreateObject(18753,-1871.89,1626.09,69.50,0.00,0.00,0.00);
- CreateObject(18784,-1944.09,1620.19,67.59,0.00,0.00,0.00);
- CreateObject(18783,-1964.00,1620.19,62.70,0.00,0.00,0.00);
- CreateObject(18783,-1779.90,1618.90,62.90,0.00,0.00,0.00);
- CreateObject(18784,-1799.59,1619.00,67.69,0.00,0.00,180.00);
- CreateObject(18774,-1810.40,1613.90,72.80,0.00,0.00,270.00);
- CreateObject(18774,-1810.40,1623.90,72.69,0.00,0.00,270.00);
- CreateObject(18774,-1933.00,1625.30,72.59,0.00,0.00,270.00);
- CreateObject(18774,-1933.00,1615.30,72.59,0.00,0.00,270.00);
- CreateObject(18750,-1870.69,1620.79,117.80,87.17,314.97,132.97);
- CreateObject(18728,-1807.09,1628.39,68.80,0.00,0.00,90.00);
- CreateObject(18728,-1807.00,1609.30,69.90,0.00,0.00,90.00);
- CreateObject(18728,-1936.30,1610.59,69.80,0.00,0.00,90.00);
- CreateObject(18728,-1936.40,1630.80,69.30,0.00,0.00,90.00);
- CreateObject(18691,-1935.89,1610.69,69.69,0.00,0.00,0.00);
- CreateObject(18691,-1935.50,1631.50,69.30,0.00,0.00,0.00);
- CreateObject(18691,-1807.80,1608.90,67.80,0.00,0.00,0.00);
- CreateObject(18691,-1808.00,1628.09,68.09,0.00,0.00,0.00);
- CreateObject(18652,-1809.09,1618.90,75.30,0.00,0.00,0.00);
- CreateObject(18650,-1936.40,1620.00,75.30,0.00,0.00,0.00);
- CreateObject(18864,-1846.00,1619.09,56.90,0.00,0.00,0.00);
- CreateObject(18864,-1947.59,1611.00,88.40,0.00,0.00,0.00);
- CreateObject(18864,-1811.00,1646.69,70.90,0.00,0.00,0.00);
- CreateObject(19076,-1773.00,1613.69,65.40,0.00,0.00,0.00);
- CreateObject(19056,-1772.59,1616.30,66.09,0.00,0.00,0.00);
- CreateObject(19057,-1775.59,1613.59,66.09,0.00,0.00,0.00);
- CreateObject(19055,-1775.00,1615.90,66.09,0.00,0.00,0.00);
- CreateObject(19076,-1969.09,1627.59,65.19,0.00,0.00,0.00);
- CreateObject(19057,-1967.40,1627.50,65.90,0.00,0.00,0.00);
- CreateObject(19056,-1967.80,1625.90,65.90,0.00,0.00,0.00);
- CreateObject(19055,-1969.50,1625.80,65.90,0.00,0.00,0.00);
- CreateObject(18766,-1960.19,1629.50,67.69,0.00,0.00,0.00);
- CreateObject(19173,-1963.39,1629.00,67.19,0.00,0.00,0.00);
- CreateObject(19174,-1960.00,1629.00,68.90,0.00,0.00,0.00);
- CreateObject(19175,-1963.19,1629.00,68.80,0.00,0.00,0.00);
- CreateObject(19172,-1956.79,1629.00,66.19,0.00,0.00,0.00);
- CreateObject(19164,-1956.89,1628.79,68.40,83.99,0.00,0.00);
- CreateObject(19168,-1960.19,1628.79,66.59,90.00,179.99,179.99);
- CreateObject(19275,-1960.19,1629.19,67.50,0.00,0.00,0.00);
- CreateObject(3308,-1824.19,1582.19,71.59,0.00,0.00,90.00);
- CreateObject(3308,-1849.00,1582.19,71.59,0.00,0.00,90.00);
- CreateObject(3309,-1874.09,1582.50,71.40,0.00,0.00,90.00);
- CreateObject(3309,-1899.00,1582.09,71.59,0.00,0.00,90.00);
- CreateObject(3309,-1923.69,1582.09,71.59,0.00,0.00,90.00);
- CreateObject(3312,-1899.29,1618.50,73.09,0.00,0.00,87.99);
- CreateObject(3312,-1874.50,1617.40,73.19,0.00,0.00,87.99);
- CreateObject(3315,-1845.40,1623.69,71.00,0.00,0.00,358.00);
- CreateObject(3315,-1877.59,1648.09,71.40,0.00,0.00,177.99);
- CreateObject(3316,-1898.50,1649.00,73.40,0.00,0.00,178.00);
- CreateObject(3353,-1818.79,1669.09,71.40,0.00,0.00,0.00);
- CreateObject(3445,-1924.89,1669.69,73.40,0.00,0.00,0.00);
- CreateObject(19129,-1779.69,1619.09,65.50,0.00,0.00,0.00);
- CreateObject(18846,-1785.50,1627.39,70.50,0.00,0.00,29.99);
- return 1;
- }
- stock IsPlayerInWater(playerid)
- {
- new animlib[32],tmp[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,tmp,32);
- if(!strcmp(animlib, "SWIM") && !IsPlayerInAnyVehicle(playerid) ) return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement