Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fappin' N' Slappin' - It's (kinda) exactly how it sounds!
- //
- // Description:
- // Basically a game of tig. (If you're British you'll know what that is.)
- // The aim of 'tig' is to touch someone. Once they've been touched, they can't move until someone frees them.
- // The last one to be touched is the next 'tigger'.
- // Fappin' N' Slappin' is basically the same without the ability to be freed.
- // Once 'tagged' with the dildo (or whatever you set as SLAP_GUN), you die, and spectate The Slapper (tigger).
- // When The Slapper has killed everyone with his instagib dildo, the game restarts.
- // When two people have spawned it will begin deciding a new player to take over the role of The Slapper.
- //
- // Basic information:
- // An RCON-enabled admin can start the game prematurely with /start. It will randomly pick a player to be The Slapper.
- // The arena is the KACC military fuels. There are three spawns; feel free to add more on line 37. (new Float:SlapSpawn[][3])
- // Or, if you'd prefer, you can change the arena completely. For interiors, remember to add SetPlayerInterior to the spawns.
- // Currently 6 classes, you can add as many as you like.
- //
- // Basic script, add whatever the hell you want to it.
- // Don't care about credits, either.
- #include a_samp
- #define SLAP_GUN 10 // Purple Dildo - Change to whatever you want (can be any weapon, not just melee!).
- #define FREEZE_ON_SPAWN // Comment to disable freezing before round begins. Will still freeze "Slapper" for 5-second head start.
- main(){}
- new
- bool:DildoChosen = false,
- DildoSlapper = INVALID_PLAYER_ID,
- bool:RoundStarted = false,
- bool:Dead[MAX_PLAYERS] = false,
- currPlayers = 0,
- currDead = 0,
- bool:Restarting = false,
- Slapping,
- Starting,
- Unfreezing;
- new Float:SlapSpawn[][3] =
- {
- {2502.0,2777.0,11.0},
- {2586.0,2823.0,11.0},
- {2619.0,2719.0,37.0}
- };
- public OnGameModeInit()
- {
- SetGameModeText("Fappin' N' Slappin'"); //Set the gamemode text.
- UsePlayerPedAnims(); //Stop people have a speed advantage due to skin animations.
- EnableStuntBonusForAll(false); //Make sure people don't get moneys for stunting in any vehicles somehow.
- DisableInteriorEnterExits(); //Make sure people can't hide inside interiors.
- SetWorldTime(12); //Make sure it's nice and bright for the players to get slapped.
- ShowPlayerMarkers(1); //Players are visible (0xFFFFFFFF), The Slapper
- ShowNameTags(false); //Make sure players don't 'metagame' The Slapper.
- AllowInteriorWeapons(true); //In case of interior arenas.
- SetWeather(0); //Make sure it's nice and bright for the players to get slapped.
- ManualVehicleEngineAndLights(); //Prevent any way of driving cars client-side without using an engine starter (eg CLEO)
- if(currPlayers < 0) currPlayers = FixPlayers(); //Used to make sure enough players are online to start the game.
- AddPlayerClass(296, SlapSpawn[0][0], SlapSpawn[0][1], SlapSpawn[0][2], 0.0, 0, 0, 0, 0, 0, 0);
- AddPlayerClass(28, SlapSpawn[1][0], SlapSpawn[1][1], SlapSpawn[1][2], 0.0, 0, 0, 0, 0, 0, 0);
- AddPlayerClass(29, SlapSpawn[2][0], SlapSpawn[2][1], SlapSpawn[2][2], 0.0, 0, 0, 0, 0, 0, 0);
- AddPlayerClass(178, SlapSpawn[0][0], SlapSpawn[0][1], SlapSpawn[0][2], 0.0, 0, 0, 0, 0, 0, 0);
- AddPlayerClass(120, SlapSpawn[1][0], SlapSpawn[1][1], SlapSpawn[1][2], 0.0, 0, 0, 0, 0, 0, 0);
- AddPlayerClass(299, SlapSpawn[2][0], SlapSpawn[2][1], SlapSpawn[2][2], 0.0, 0, 0, 0, 0, 0, 0);
- Restarting = false; //Is the server restarting? Stops the "The Slapper has left the game, restarting!" bug when GMXing.
- }
- stock FixPlayers()
- {
- new O;
- for(new i; i < GetMaxPlayers(); i++)
- {
- if(IsPlayerConnected(i))
- {
- O += 1;
- }
- }
- return O;
- }
- public OnPlayerConnect(playerid)
- {
- new s[128];
- format(s, 128, "[SERVER]{FFFFFF}: {FFAA00}%s{FFFFFF} has {00AA00}joined{FFFFFF} the game!", N(playerid));
- SendClientMessageToAll(0x33CCFF00, s);
- Dead[playerid] = false;
- currPlayers = FixPlayers();
- if(currPlayers > 1)
- {
- if(RoundStarted == true) return;
- if(DildoChosen == false && !Slapping)
- {
- Slapping = SetTimer("ChooseSlapper", 5000, 0);
- SendClientMessageToAll(0x33CCFF00, "[SERVER]{FFFFFF}: Now choosing The Slapper!");
- }
- }
- return;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/start", true))
- {
- if(IsPlayerAdmin(playerid))
- {
- DildoSlapper = (random(FixPlayers()) - 1);
- for(new i; i < GetMaxPlayers(); i++)
- {
- TogglePlayerControllable(i, true);
- }
- GameTextForAll("~g~GO~w~!", 5000, 5);
- currDead = 0;
- UnfreezeSlapper();
- if(Slapping) KillTimer(Slapping);
- if(Starting) KillTimer(Starting);
- if(Unfreezing) KillTimer(Unfreezing);
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/credits", true))
- {
- return SendClientMessage(playerid, 0xC2A2DA00, "[INFO]{FFFFFF}: Original Fap N' Slap - [FMJ]PowerSurge/Skelebob9/Joey_Tucker");
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- switch(classid)
- {
- case 0,3:
- {
- SetPlayerPos(playerid, SlapSpawn[0][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- SetPlayerFacingAngle(playerid, 0.0);
- SetPlayerCameraPos(playerid, SlapSpawn[0][0], SlapSpawn[0][1]+3, SlapSpawn[0][2]);
- SetPlayerCameraLookAt(playerid, SlapSpawn[0][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- }
- case 1,4:
- {
- SetPlayerPos(playerid, SlapSpawn[1][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- SetPlayerFacingAngle(playerid, 0.0);
- SetPlayerCameraPos(playerid, SlapSpawn[1][0], SlapSpawn[0][1]+3, SlapSpawn[0][2]);
- SetPlayerCameraLookAt(playerid, SlapSpawn[1][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- }
- case 2,5:
- {
- SetPlayerPos(playerid, SlapSpawn[2][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- SetPlayerFacingAngle(playerid, 0.0);
- SetPlayerCameraPos(playerid, SlapSpawn[2][0], SlapSpawn[0][1]+3, SlapSpawn[0][2]);
- SetPlayerCameraLookAt(playerid, SlapSpawn[2][0], SlapSpawn[0][1], SlapSpawn[0][2]);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(reason != SLAP_GUN || killerid != DildoSlapper)
- {
- SpawnPlayer(playerid);
- }
- if(playerid == DildoSlapper)
- {
- EndGame();
- }
- }
- public OnPlayerDisconnect(playerid)
- {
- if(Restarting == false)
- {
- new s[128];
- format(s, 128, "[SERVER]{FFFFFF}: {FFAA00}%s{FFFFFF} has {FF0000}left{FFFFFF} the game!", N(playerid));
- SendClientMessageToAll(0x33CCFF00, s);
- Dead[playerid] = false;
- currPlayers -= FixPlayers();
- if(playerid == DildoSlapper)
- {
- GameTextForAll("~r~THE SLAPPER HAS LEFT~w~ ~n~RESTARTING", 7500, 5);
- SendRconCommand("gmx");
- }
- }
- return;
- }
- stock EndGame()
- {
- for(new u; u < GetMaxPlayers(); u++)
- {
- if(u != DildoSlapper && Dead[u] == true)
- {
- new s[128];
- format(s, 128, "~b~%s ~w~wins~w~!~n~~r~RESTARTING", N(DildoSlapper));
- GameTextForAll(s, 5000, 5);
- }
- }
- currDead = 0;
- currPlayers = 0;
- DildoChosen = false;
- DildoSlapper = INVALID_PLAYER_ID;
- Restarting = true;
- if(Slapping) KillTimer(Slapping);
- if(Starting) KillTimer(Starting);
- if(Unfreezing) KillTimer(Unfreezing);
- SendRconCommand("gmx");
- return;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
- {
- if(weaponid == SLAP_GUN && issuerid == DildoSlapper)
- {
- GameTextForPlayer(playerid, "~r~DEAD~w~!", 3000, 5);
- GameTextForPlayer(playerid, "~g~KILLED~w~!", 3000, 5);
- SendDeathMessage(issuerid, playerid, SLAP_GUN);
- Dead[playerid] = true;
- currDead++;
- TogglePlayerSpectating(playerid, true);
- PlayerSpectatePlayer(playerid, issuerid, SPECTATE_MODE_NORMAL);
- if(currDead == (FixPlayers() - 1))
- {
- EndGame();
- }
- }
- return;
- }
- public OnPlayerSpawn(playerid)
- {
- new r;
- r = random(sizeof(SlapSpawn));
- if(DildoChosen == true)
- {
- if(RoundStarted == true)
- {
- TogglePlayerSpectating(playerid, true);
- PlayerSpectatePlayer(playerid, DildoSlapper, SPECTATE_MODE_NORMAL);
- new
- s[128];
- format(s, 128, "[SERVER]{FFFFFF}: The round has already started with {00AA00}%s{FFFFFF} as The Slapper. Please wait until next round.", N(DildoSlapper));
- SendClientMessage(playerid, 0x33CCFF00, s);
- Dead[playerid] = true;
- SetPlayerColor(playerid, 0xAAAAAA00); //Grey colour (spectating), not visible on map
- }
- else
- {
- SetPlayerPos(playerid, SlapSpawn[r][0], SlapSpawn[r][1], SlapSpawn[r][2]);
- #if defined FREEZE_ON_SPAWN
- TogglePlayerControllable(playerid, false);
- #endif
- new
- s[128];
- format(s, 128, "[SERVER]{FFFFFF}: The round is about to start with {00AA00}%s{FFFFFF} as The Slapper.", N(DildoSlapper));
- SendClientMessage(playerid, 0x33CCFF00, s);
- Dead[playerid] = false;
- SetPlayerColor(playerid, 0xFFFFFFFF); //White colour, visible on map
- }
- }
- else
- {
- SetPlayerPos(playerid, SlapSpawn[r][0], SlapSpawn[r][1], SlapSpawn[r][2]);
- #if defined FREEZE_ON_SPAWN
- TogglePlayerControllable(playerid, false);
- #endif
- new
- s[128];
- format(s, 128, "[SERVER]{FFFFFF}: Deciding The Slapper. Currently, {00AA00}no one{FFFFFF} is The Slapper.");
- SendClientMessage(playerid, 0x33CCFF00, s);
- Dead[playerid] = false;
- SetPlayerColor(playerid, 0xFFFFFFFF);
- }
- SetPlayerHealth(playerid, 10000);
- return;
- }
- forward ChooseSlapper();
- public ChooseSlapper()
- {
- if(FixPlayers() > 1)
- {
- new r = random(FixPlayers());
- if(IsPlayerConnected(r))
- {
- KillTimer(Slapping);
- if(Starting) KillTimer(Starting);
- DildoSlapper = (r);
- DildoChosen = true;
- Starting = SetTimer("StartRound", 5000, 0);
- TogglePlayerControllable(DildoSlapper, false);
- }
- else
- {
- ChooseSlapper();
- }
- return;
- }
- }
- /*stock formatBool(bool:Bool) //For pre-release debugging
- {
- new s[5];
- if(Bool == true) s = "Yes";
- else s = "No";
- return s;
- }*/
- forward StartRound();
- public StartRound()
- {
- if(FixPlayers() > 1)
- {
- if(DildoChosen == true)
- {
- if(IsPlayerConnected(DildoSlapper))
- {
- if(GetPlayerState(DildoSlapper) != PLAYER_STATE_WASTED)
- {
- RoundStarted = true;
- SendClientMessageToAll(0xC2A2DAFF, "[INFO]{FFFFFF}: The round has begun!");
- for(new i; i < GetMaxPlayers(); i++)
- {
- if(i != DildoSlapper)
- {
- TogglePlayerControllable(i, true);
- GameTextForPlayer(i, "~g~GO~w~!", 5000, 5);
- currDead = 0;
- }
- else
- {
- GameTextForPlayer(DildoSlapper, "WAIT ~r~5~w~ seconds!", 5000, 5);
- Unfreezing = SetTimer("UnfreezeSlapper", 5000, 0);
- }
- }
- }
- else
- {
- SendClientMessageToAll(0x33CCFF00, "[SERVER]{FFFFFF}: Choosing The Slapper again, current is not spawned!");
- Slapping = SetTimer("ChooseSlapper", 5000, 0);
- }
- }
- else
- {
- SendClientMessageToAll(0x33CCFF00, "[SERVER]{FFFFFF}: Choosing The Slapper again, current is not online!");
- Slapping = SetTimer("ChooseSlapper", 5000, 0);
- }
- }
- else
- {
- SendClientMessageToAll(0x33CCFF00, "[SERVER]{FFFFFF}: Choosing The Slapper again, current is not online!");
- Slapping = SetTimer("ChooseSlapper", 5000, 0);
- }
- }
- else
- {
- SendClientMessageToAll(0xFF634700, "[ERROR]{FFFFFF}: Not enough players to start round - aborted!");
- return;
- }
- return;
- }
- forward UnfreezeSlapper();
- public UnfreezeSlapper()
- {
- GameTextForAll("~p~The Slapper ~w~has been unfrozen! ~r~Run~w~!", 5000, 5);
- TogglePlayerControllable(DildoSlapper, true);
- GivePlayerWeapon(DildoSlapper, SLAP_GUN, 65535);
- SetPlayerColor(DildoSlapper, 0xFF000000); //Red colour, not visible on minimap
- }
- stock N(u)
- {
- new
- n[32];
- GetPlayerName(u, n, 32);
- for(new m; m < 32; m++)
- {
- if(n[m] == '_')
- n[m] = ' ';
- }
- return n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement