Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:rrl(playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /rrl [playerid]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 5)
- {
- if(Player[playerid][PrisonID] >= 0 && Player[playerid][PrisonDuration] >= 0 || Player[playerid][Cuffed] >= 0 || Player[playerid][Tazed] >= 0 || Player[playerid][Tied] >= 0)
- {
- if(Player[id][PrisonID] >= 0 && Player[id][PrisonDuration] >= 0 || Player[id][Cuffed] >= 0 || Player[id][Tazed] >= 0 || Player[id][Tied] >= 0)
- {
- format(string, sizeof(string), "You have challenged %s for a game of Russian Roulette!", GetName(id));
- SendClientMessage(playerid, BLUE, string);
- format(string, sizeof(string), "%s has challenged you for a game of Russian Roulette, /arrl to accept, or /drrl to decline!", GetName(playerid));
- SendClientMessage(playerid, BLUE, string);
- Player[playerid][SRRR] = 1;
- Player[id][HRRR] = 1;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You can't do this as the player is prisoned, cuffed, tazed or tied!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You can't do this as you're prisoned, cuffed, tazed or tied!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are to far away to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "This player is not connected!");
- }
- }
- return 1;
- }
- CMD:arrl(playerid, params[])
- {
- new string[128], id;
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /arrl [playerid]");
- }
- else
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 5)
- {
- if(Player[id][HRRR] == 1)
- {
- if(Player[playerid][SRRR] == 1)
- {
- format(string, sizeof(string), "%s has accepted your game request of Russian Roulette, good luck.", GetName(id));
- SendClientMessage(playerid, BLUE, string);
- format(string, sizeof(string), "You have accepted a game of Russian Roulette by %s, good luck.", GetName(playerid));
- SendClientMessage(playerid, BLUE, string);
- format(string, sizeof(string), "*%s and %s are now playing a game of Russian Roulette!", GetName(id), GetName(playerid));
- NearByMessage(playerid, NICESKY, string);
- Player[id][HRRR] = 0;
- Player[playerid][SRRR] = 0;
- Player[id][InRRL] = 1;
- Player[playerid][InRRL] = 1;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "This player hasn't sent you a Russian Roulette request!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a Russian Roulette request!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are to far away from the player!");
- }
- }
- return 1;
- }
- CMD:drrl(playerid, params[])
- {
- new string[128], id;
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /drrl [playerid]");
- }
- else
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 5)
- {
- if(Player[id][HRRR] == 1)
- {
- if(Player[playerid][SRRR] == 1)
- {
- format(string, sizeof(string), "%s has declined your game request of Russian Roulette!", GetName(id));
- SendClientMessage(playerid, BLUE, string);
- format(string, sizeof(string), "You have declined a game of Russian Roulette by %s!", GetName(playerid));
- SendClientMessage(playerid, BLUE, string);
- Player[id][HRRR] = 0;
- Player[playerid][SRRR] = 0;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "This player hasn't sent you a Russian Roulette request!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a Russian Roulette request!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are to far away from the player!");
- }
- }
- return 1;
- }
- CMD:usegun(playerid, params[])
- {
- new string[128], id;
- new rand = random(6);
- switch(rand)
- {
- case 0, 1, 2, 3:
- {
- if(Player[playerid][InRRL] == 1)
- {
- format(string, sizeof(string), "%s pulls the trigger, their was no bullet in that chamber!", GetName(playerid));
- NearByMessage(playerid, NICESKY, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a game of Russian Roulette!");
- }
- }
- case 4, 5, 6:
- {
- if(Player[playerid][InRRL] == 1)
- {
- format(string, sizeof(string), "%s pulls the trigger, the bullet goes through their head and kills them!", GetName(playerid));
- NearByMessage(playerid, NICESKY, string);
- SetPlayerHealth(playerid, 0);
- Player[id][InRRL] = 0;
- Player[playerid][InRRL] = 0;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a game of Russian Roulette!");
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment