Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * * * * * * * * * * * * * * * * * * * * * * * *
- * CREDITS : *
- * ARRETDEFIL - MRTOINOU - I-ZCMD (YASHAS) *
- * *
- * * * * * * * * * * * * * * * * * * * * * * * * *
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_RED 0xAA3333AA
- #define TEAM_MURDER 0
- #define TEAM_GUN 1
- #define TEAM_INNOCENT 2
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- // <> <> <> <> <> <> <> <> <> TEXTDRAWS <> <> <> <> <> <> <> <>
- new Text:Textdraw0;
- new Text:Textdraw1;
- new Text:Textdraw2;
- new Text:Textdraw3;
- new Text:Textdraw4;
- new Text:Textdraw5;
- new PlayerText:Textdraw00[MAX_PLAYERS];
- new id;
- // <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
- new points[MAX_PLAYERS];
- new Actor[MAX_ACTORS];
- new gPlayerTeam[MAX_PLAYERS];
- new Float:RandomSpawns[][] =
- {
- {1278.6624,-813.8312,1085.6328},
- {1294.1095,-827.7710,1085.6328},
- {1247.9601,-820.7675,1084.0078},
- {1234.9125,-824.3225,1083.1563},
- {1234.9871,-809.2429,1084.0078},
- {1267.0770,-813.1758,1084.0078},
- {1272.4529,-813.3427,1084.0078},
- {1284.8055,-801.5486,1084.0078},
- {1284.4454,-787.0720,1084.0078},
- {1267.0936,-795.9094,1084.0078},
- {1240.1737,-780.3179,1084.0149},
- {1249.0775,-765.6386,1084.0156},
- {1266.4635,-782.5561,1084.0078},
- {1262.3259,-782.5859,1084.0078},
- {1290.5151,-766.2123,1084.0078},
- {1280.5310,-783.5627,1084.0078}
- };
- new RandomTeams[][] =
- {
- {TEAM_MURDER},
- {TEAM_GUN},
- {TEAM_INNOCENT}
- };
- main()
- {
- print("\n<> <> <> <> <> <> <> <> <> <> <> <> ");
- print(" <> <> <> The Murderer <> <> <> <> ");
- print("<> <> <> <> <> <> <> <> <> <> <> <> \n");
- }
- // <> <> <> <> <> <> <> <> <> <> ZCMD COMMANDS <> <> <> <> <> <> <> <> <> <> <> <> <>
- CMD:kill(playerid,params[]) { SetPlayerHealth(playerid,0.0); return 1; }
- CMD:givecred(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_YELLOW,"+10 free points !");
- points[playerid]+=10;
- new getpoints[16]; format(getpoints,sizeof(getpoints),"%d",points[playerid]);
- PlayerTextDrawSetString(playerid, Textdraw00[playerid], getpoints);
- return 1;
- }
- CMD:qg(playerid,params[])
- {
- SetPlayerInterior(playerid,5);
- SetPlayerPos(playerid,1267.663208,-781.323242,1091.906250);
- return 1;
- }
- CMD:team(playerid,params[])
- {
- if(gPlayerTeam[playerid] == 0) { SendClientMessage(playerid,-1,"Team MURDER"); }
- if(gPlayerTeam[playerid] == 1) { SendClientMessage(playerid,-1,"Team GUN"); }
- if(gPlayerTeam[playerid] == 2) { SendClientMessage(playerid,-1,"Team INNOCENT"); }
- return 1;
- }
- public OnGameModeInit()
- {
- ShowPlayerMarkers(0);
- Textdraw0 = TextDrawCreate(560.399000, 7.874948, "The Murderer");
- TextDrawLetterSize(Textdraw0, 0.309999, 1.454168);
- TextDrawTextSize(Textdraw0, 639.375000, 17.499996);
- TextDrawAlignment(Textdraw0, 1);
- TextDrawColor(Textdraw0, -1);
- TextDrawSetShadow(Textdraw0, 0);
- TextDrawSetOutline(Textdraw0, 1);
- TextDrawBackgroundColor(Textdraw0, 51);
- TextDrawFont(Textdraw0, 1);
- TextDrawSetProportional(Textdraw0, 1);
- Textdraw1 = TextDrawCreate(10.625000, 428.749969, "Murderer:");
- TextDrawLetterSize(Textdraw1, 0.343749, 1.570833);
- TextDrawAlignment(Textdraw1, 1);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetShadow(Textdraw1, 0);
- TextDrawSetOutline(Textdraw1, 1);
- TextDrawBackgroundColor(Textdraw1, 51);
- TextDrawFont(Textdraw1, 1);
- TextDrawSetProportional(Textdraw1, 1);
- Textdraw2 = TextDrawCreate(71.875000, 429.333465, "-");
- TextDrawLetterSize(Textdraw2, 0.381249, 1.512499);
- TextDrawAlignment(Textdraw2, 1);
- TextDrawColor(Textdraw2, 16711935);
- TextDrawSetShadow(Textdraw2, 0);
- TextDrawSetOutline(Textdraw2, 1);
- TextDrawBackgroundColor(Textdraw2, 51);
- TextDrawFont(Textdraw2, 1);
- TextDrawSetProportional(Textdraw2, 1);
- Textdraw3 = TextDrawCreate(120.625000, 428.750030, "Deagle:");
- TextDrawLetterSize(Textdraw3, 0.343749, 1.541666);
- TextDrawAlignment(Textdraw3, 1);
- TextDrawColor(Textdraw3, -1);
- TextDrawSetShadow(Textdraw3, 0);
- TextDrawSetOutline(Textdraw3, 1);
- TextDrawBackgroundColor(Textdraw3, 51);
- TextDrawFont(Textdraw3, 1);
- TextDrawSetProportional(Textdraw3, 1);
- Textdraw4 = TextDrawCreate(170.000000, 431.083343, "-");
- TextDrawLetterSize(Textdraw4, 0.399998, 1.395833);
- TextDrawAlignment(Textdraw4, 1);
- TextDrawColor(Textdraw4, 16711935);
- TextDrawSetShadow(Textdraw4, 0);
- TextDrawSetOutline(Textdraw4, 1);
- TextDrawBackgroundColor(Textdraw4, 51);
- TextDrawFont(Textdraw4, 1);
- TextDrawSetProportional(Textdraw4, 1);
- Textdraw5 = TextDrawCreate(476.250000, 428.166625, "POINTS:");
- TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
- TextDrawAlignment(Textdraw5, 1);
- TextDrawColor(Textdraw5, -1);
- TextDrawSetShadow(Textdraw5, 0);
- TextDrawSetOutline(Textdraw5, 1);
- TextDrawBackgroundColor(Textdraw5, 51);
- TextDrawFont(Textdraw5, 3);
- TextDrawSetProportional(Textdraw5, 1);
- TextDrawShowForAll(Textdraw0);
- TextDrawShowForAll(Textdraw1);
- TextDrawShowForAll(Textdraw2);
- TextDrawShowForAll(Textdraw3);
- TextDrawShowForAll(Textdraw4);
- TextDrawShowForAll(Textdraw5);
- ShowNameTags(0);
- SetGameModeText("The Murderer");
- AddPlayerClass(160, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1281.0375,-829+20,1090.5938);
- SetPlayerCameraPos(playerid, 1281.0375,-829.7905,1090.5938);
- SetPlayerCameraLookAt(playerid, 1269.5922,-835.7245,1085.6328);
- SetPlayerInterior(playerid,5);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPlayerTime(playerid, 0, 0);
- points[playerid] = 0;
- new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s has joined the server.", name);
- SendClientMessageToAll(COLOR_GREY, string);
- Textdraw00[playerid] = CreatePlayerTextDraw(playerid, 541.875000, 429.916778, "0");
- PlayerTextDrawLetterSize(playerid, Textdraw00[playerid], 0.449999, 1.600000);
- PlayerTextDrawAlignment(playerid, Textdraw00[playerid], 2);
- PlayerTextDrawColor(playerid, Textdraw00[playerid], -5963521);
- PlayerTextDrawSetShadow(playerid, Textdraw00[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Textdraw00[playerid], 1);
- PlayerTextDrawBackgroundColor(playerid, Textdraw00[playerid], 51);
- PlayerTextDrawFont(playerid, Textdraw00[playerid], 1);
- PlayerTextDrawSetProportional(playerid, Textdraw00[playerid], 1);
- PlayerTextDrawShow(playerid, Textdraw00[playerid]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s has left.", name);
- SendClientMessageToAll(COLOR_GREY, string);
- if(gPlayerTeam[playerid] == 0) // If Murderer disconnect
- {
- TextDrawSetString(Textdraw2, "-");
- }
- if(gPlayerTeam[playerid] == 1) // If Deagle disconnect
- {
- TextDrawSetString(Textdraw4, "-");
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new Random = random(sizeof(RandomSpawns));
- SetPlayerInterior(playerid,5);
- SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
- new RandomTeam = random(3);
- gPlayerTeam[playerid] = RandomTeams[RandomTeam][0];
- if(gPlayerTeam[playerid] == 0)
- {
- TextDrawSetString(Textdraw2, "Alive");
- SendClientMessage(playerid,COLOR_RED,"You're the murderer, be quiet and kill the other players ! Try to not be spotted by the Deagle");
- GivePlayerWeapon(playerid,4,1);
- }
- if(gPlayerTeam[playerid] == 1)
- {
- TextDrawSetString(Textdraw4, "Alive");
- SendClientMessage(playerid,COLOR_YELLOW,"You're the Deagle, find the murderer and kill him !");
- GivePlayerWeapon(playerid,24,200);
- }
- if(gPlayerTeam[playerid] == 2)
- {
- SendClientMessage(playerid,-1,"You're the civilian, get away from the murderer ");
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(gPlayerTeam[playerid] == 0) // If Murderer died
- {
- TextDrawSetString(Textdraw2, "-");
- }
- if(gPlayerTeam[killerid] == 0) // If Murdered someone
- {
- SendClientMessage(killerid,COLOR_RED,"+1 point");
- points[killerid]+=1;
- new getpoints[16]; format(getpoints,sizeof(getpoints),"%d",points[killerid]);
- PlayerTextDrawSetString(killerid, Textdraw00[killerid], getpoints);
- }
- if(gPlayerTeam[killerid] == 0 && gPlayerTeam[playerid] == 1) // If Murderer killed Deagle
- {
- SendClientMessage(killerid,COLOR_RED,"+2 points, for killing the Deagle !");
- points[killerid]+=2;
- new getpoints[16]; format(getpoints,sizeof(getpoints),"%d",points[killerid]);
- PlayerTextDrawSetString(killerid, Textdraw00[killerid], getpoints);
- TextDrawSetString(Textdraw4, "-");
- }
- if(gPlayerTeam[playerid] == 1) // If Deagle died
- {
- SendClientMessage(playerid,-1,"You're not a Deagle anymore");
- TextDrawSetString(Textdraw4, "-");
- }
- if(gPlayerTeam[playerid] == 0 && gPlayerTeam[killerid] == 1) // If Deagle kill Murderer
- {
- SendClientMessage(playerid,-1,"You killed the murderer ! +2 points");
- points[playerid]+=2;
- new getpoints[16]; format(getpoints,sizeof(getpoints),"%d",points[playerid]);
- PlayerTextDrawSetString(playerid, Textdraw00[playerid], getpoints);
- TextDrawSetString(Textdraw2, "-");
- if(points[playerid] >=8) { SendClientMessage(playerid,-1,"You can now create a clone by pressing N"); }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- SpawnPlayer(playerid);
- return 1;
- }
- public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
- {
- /*
- if(gPlayerTeam[playerid] == 0) {
- SendClientMessage(playerid,COLOR_RED,"It is a clone .. ");
- SetActorHealth(damaged_actorid,0);
- }
- else { SendClientMessage(playerid,COLOR_YELLOW,"It's a clone, let it alone !"); SetActorHealth(damaged_actorid,100); } */
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(gPlayerTeam[playerid] == 1 && gPlayerTeam[hitid] == 2)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Oops ! You didn't shoot the murderer, you died !");
- SetPlayerHealth(playerid,0);
- SetPlayerHealth(hitid,100);
- }
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_NO))
- {
- if(gPlayerTeam[playerid] == 1)
- {
- if(points[playerid]>=8)
- {
- SendClientMessage(playerid,COLOR_RED,"You've just created a clone !");
- new Float:angle; GetPlayerFacingAngle(playerid, angle);
- new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z);
- new skin; skin = GetPlayerSkin(playerid);
- id = playerid;
- Actor[id] = CreateActor(skin, x, y+2, z, angle);
- points[playerid]=points[playerid]-8;
- new getpoints[16]; format(getpoints,sizeof(getpoints),"%d",points[playerid]);
- PlayerTextDrawSetString(playerid, Textdraw00[playerid], getpoints);
- }
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment