Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new string[128];
- enum pinfo
- {
- DM,
- KillStreak,
- }
- new PlayerInfo[MAX_PLAYERS][pinfo];
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerInfo[playerid][DM] = 0;
- PlayerInfo[playerid][KillStreak] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerInfo[playerid][DM] = 0;
- PlayerInfo[playerid][KillStreak] = 0;
- return 1;
- }
- forward Unfreeze(playerid);
- CMD:dm(playerid,params[])
- {
- TogglePlayerControllable(playerid, false); // Freeze the player
- SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Make a 5 second timer for that player to get u
- PlayerInfo[playerid][DM] = 1;
- SetPlayerInterior(playerid, 10);
- new rand = random(2);
- if(rand == 0) SetPlayerPos(playerid, -1330.84,1057.67,1346.45);
- else SetPlayerPos(playerid, -974.35,1060.86,1345.64);
- PlayerInfo[playerid][KillStreak] = 0;
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid,31,700);
- return 1;
- }
- CMD:leave(playerid,params[])
- {
- PlayerInfo[playerid][DM] = 0;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth(playerid,0);
- SetPlayerInterior(playerid, 0);
- ResetPlayerWeapons(playerid);
- // SetPlayerPos here to your spawn location
- }
- public OnPlayerSpawn(playerid)
- {
- if(PlayerInfo[playerid][DM] = 1)
- {
- TogglePlayerControllable(playerid, false); // Freeze the player
- SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Make a 5 second timer for that player to get u
- SetPlayerInterior(playerid, 10);
- new rand = random(2);
- if(rand == 0) SetPlayerPos(playerid, -1330.84,1057.67,1346.45);
- else SetPlayerPos(playerid, -974.35,1060.86,1345.64);
- PlayerInfo[playerid][KillStreak] = 0;
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid,31,700);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new killername[24];
- new pname[24];
- GetPlayerName(playerid,pname,sizeof(pname));
- GetPlayerName(killerid,killername,sizeof(killername));
- new Float:health;
- GetPlayerHealth(killerid,health);
- if(PlayerInfo[killerid][KillStreak] = 0 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 1;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 1 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 2;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 2 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 3;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 3 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 4;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 4 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 5;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- GivePlayerWeapon(killerid,24,700);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}five {FFFFFF}kill streak and he has recieved a {D9D975}deagle{FFFFFF}!",PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 5 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 6;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 6 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 7;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 7 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 8;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 8 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 9;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 9 && health > 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 10;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- GivePlayerWeapon(killerid,26,700);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}ten {FFFFFF}kill streak and he has recieved a {D9D975}Sawn Off Shotgun{FFFFFF}!",PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 0 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 1;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 1 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 2;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 2 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 3;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 3 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 4;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 4 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 5;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- GivePlayerWeapon(killerid,24,700);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}five {FFFFFF}kill streak and he has recieved a {D9D975}deagle{FFFFFF}!",PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 5 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 6;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 6 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 7;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 7 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 8;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 8 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 9;
- PlayerInfo[playerid][KillStreak] = 0;
- SetPlayerHealth (killerid,health + 10.0);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- if(PlayerInfo[killerid][KillStreak] = 9 && health < 50.0)
- {
- PlayerInfo[killerid][KillStreak] = 10;
- PlayerInfo[playerid][KillStreak] = 0;
- GivePlayerWeapon(killerid,26,700);
- GivePlayerMoney(killerid,15000);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][DM] == 1)
- {
- format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}ten {FFFFFF}kill streak and he has recieved a {D9D975}Sawn Off Shotgun{FFFFFF}!",PlayerName(playerid),playerid);
- SendClientMessage(i,-1,string);
- }
- }
- return 0;
- }
- return 1;
- }
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
- public Unfreeze(playerid)
- {
- TogglePlayerControllable(playerid, true); // Unfreeze the player after 5 seconds
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement