rendered paste body#include <a_samp>
//colori
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x1111AAFF
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
//-------------------------------------------------------------------------
new consecutive[MAX_PLAYERS];
new st;
new inshop[MAX_PLAYERS];
new remove;
//-------------------------------------------------------------------------
main()
{
print("\nLoaded Big Smoke's Crack Palace DM 0.1\n");
}
//-------------------------------------------------------------------------
public OnGameModeInit()
{
SetTimer("EndOfGamemode", 1200000, 0); // 20 minutes
st = 0;
SetGameModeText("Big Smoke's Crack Palace DM 0.1");
ShowPlayerMarkers(0);
ShowNameTags(1);
AddPlayerClass(0,2543.2283,-1304.3867,1025.0743,176.7943,24,700,25,100,29,700); // spawn
AddPlayerClass(103,2527.9026,-1290.1290,1031.4219,183.3510,24,700,25,100,30,3000); // spawn1
AddPlayerClass(102,2571.4099,-1286.6647,1031.4219,182.0976,24,700,29,700,4,1); // spawn2
AddPlayerClass(115,2538.8955,-1293.5408,1044.1250,271.0617,24,700,29,700,5,1); // spawn3
AddPlayerClass(114,2521.1069,-1281.8789,1054.6406,174.8441,23,3000,31,3000,25,100); // spawn4
AddPlayerClass(1,2547.2249,-1288.8175,1054.6406,171.3974,24,700,29,700,4,1); // spawn5
AddPlayerClass(23,2579.7998,-1284.3066,1065.3596,91.1833,24,700,29,700,6,1); // spawn6
//AddStaticVehicle(601,,,,,,,);
AddStaticPickup(1240, 2, 2550.09,-1297.159,1060.984);
AddStaticPickup(1240, 2, 2526.385,-1285.134,1048.289);
AddStaticPickup(1240, 2, 2575.61,-1286.737,1037.773);
AddStaticPickup(356, 2, 2561.171,-1302.578,1054.641);
SetWorldTime(0);
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF8A00AA, "Welcome to Big Smoke's Crack Palace DM 0.1 [coded by [DaT]Chiarboss]");
SendClientMessage(playerid, 0xFFFFFFAA, "Type /about if you don't now how this mode work");
SendClientMessage(playerid, 0xFFFF00AA, "Type /help for knowing the rules of GM");
GameTextForPlayer(playerid, "~g~- ~r~Crack Palace ~y~Deathmatch ~g~-", 6000, 1);
GameTextForPlayer(playerid,"~n~~n~~r~Choice ~w~a character!",3000,3);
GivePlayerMoney(playerid, 1000);
SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive
inshop[playerid] = 0;
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerText(playerid)
{
printf("OnPlayerText(%d)", playerid);
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerInfoChange(playerid)
{
printf("OnPlayerInfoChange(%d)");
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,2);
PlayerPlaySound(playerid, 1098, 0, 0, 0);
consecutive[playerid] = 0;
SetPlayerCheckpoint(playerid,2561.5405,-1285.4424,1054.6406,2.5);
GameTextForPlayer(playerid,"~n~~n~~r~Search ~w~the players and ~r~kill ~w~them!!!", 5000, 3);
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
new name[MAX_PLAYER_NAME];
new died[MAX_PLAYER_NAME];
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
}
else
{
st++;
GetPlayerName(killerid,name, sizeof(name));
GivePlayerMoney(killerid, 1000);
SendDeathMessage(killerid, playerid, reason);
consecutive[killerid]++;
if(reason == 0 || reason==2 || reason==4 || reason==5 || reason==6 || reason==8) // Fixed by Roby65
{
GetPlayerName(playerid,died, sizeof(died));
GetPlayerName(killerid,name, sizeof(name));
format(string, sizeof(string), "~y~%s ~w~has got humiliated! +3 kills to ~r~%s!!", died, name);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 3);
GameTextForAll(string, 6000, 6);
}
else
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
if(st == 1)
{
format(string, sizeof(string), "~y~%s ~w~made the first kill! +3 kills to him!",name);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
GameTextForAll(string, 6000, 6);
}
if(consecutive[killerid] == 5)
{
format(string, sizeof(string), "~y~%s ~w~is rockin' out!",name);
GameTextForAll(string, 6000, 6);
}
else if(consecutive[killerid] == 6)
{
format(string, sizeof(string), "OMG! ~y~%s ~w~is pwning you all!",name);
GameTextForAll(string, 6000, 6);
}
else if(consecutive[killerid] == 7)
{
format(string, sizeof(string), "WOW! ~y~%s ~w~is an omicide fury!",name);
GameTextForAll(string, 6000, 6);
}
else if(consecutive[killerid] >= 8)
{
format(string, sizeof(string), "~y~%s~w~: the king of the server... 0.0",name);
GameTextForAll(string, 6000, 6);
}
}
return 1;
}
//-------------------------------------------------------------------------
public SetupPlayerForClassSelection(playerid)
{
PlayerPlaySound(playerid, 1097, 0, 0, 0);
SetPlayerPos(playerid,2521.3723,-1272.7750,34.8932);
SetPlayerFacingAngle(playerid,88.8214);
SetPlayerCameraPos(playerid,2518.5557,-1272.7352,34.8751);
SetPlayerCameraLookAt(playerid,2518.5557,-1272.7352,34.8751);
}
//-------------------------------------------------------------------------
public OnPlayerRequestClass(playerid, classid)
{
printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
SetupPlayerForClassSelection(playerid);
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerEnterCheckpoint(playerid)
{
new name[MAX_PLAYER_NAME];
new string[256];
remove = SetTimer("ExitShop", 30000, 0);
TogglePlayerControllable(playerid,0);
inshop[playerid] = 1;
GetPlayerName(playerid,name, sizeof(name));
format(string, sizeof(string), "- Welcome to Crack Arsenal, %s; -",name);
SendClientMessage(playerid, 0xFF8A00AA, string);
SendClientMessage(playerid, 0xFF8A00AA, "Here you can buy:");
SendClientMessage(playerid, 0xFF8A00AA, "----------------------------------");
SendClientMessage(playerid, 0xFF8A00AA, "/100hp [1000$]");
SendClientMessage(playerid, 0xFF8A00AA, "/sawnoff [2000$]");
SendClientMessage(playerid, 0xFF8A00AA, "/exit");
SendClientMessage(playerid, 0xFF8A00AA, "----------------------------------");
GameTextForPlayer(playerid, "~n~~r~P.S.: ~w~if you dont ~r~exit ~w~the shop in 30 second ~r~you will be removed.",3000,3);
return 1;
}
//-------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/help", true) == 0)
{
SendClientMessage(playerid,0xFFFF00AA,"This is a simply DM in Big Smoke's Crack Palace");
SendClientMessage(playerid,0xFFFF00AA,"The objective is only that one scovare the other players and kill them.");
SendClientMessage(playerid,0xFFFF00AA,"Type /cmdlist for knowing the list of Commands...");
return 1;
}
if(strcmp(cmd, "/about", true) == 0)
{
SendClientMessage(playerid,0xFFFFFFAA,"Big Smoke's Crack Palace DM 0.1");
SendClientMessage(playerid,0xFFFFFFAA,"This gamemode was created by [DaT]Chiarboss;");
SendClientMessage(playerid,0xFFFFFFAA,"Do NOT copy this gamemode code or part of it.");
return 1;
}
if(strcmp(cmd, "/cmdlist", true)==0){
SendClientMessage(playerid,0xFFFF00AA,"/cmdlist ;");
SendClientMessage(playerid,0xFFFF00AA,"/help ;");
SendClientMessage(playerid,0xFFFF00AA,"/about ;");
SendClientMessage(playerid,0xFFFF00AA,"/shophelp ;");
return 1;
}
if(strcmp(cmd, "/shophelp", true)==0){
SendClientMessage(playerid,0xFFFF00AA,"If you are in the red checkpoint at the secret room in the Ballas Saloon,");
SendClientMessage(playerid,0xFFFF00AA,"press /100hp for recharge your hpbar for 1000$;");
SendClientMessage(playerid,0xFFFF00AA,"press /sawnoff for buy a Sawn Off Shotgun for 2000$;");
SendClientMessage(playerid,0xFFFF00AA,"press /exit for exit from the shop...");
SendClientMessage(playerid,0xFFFF00AA,"...if you dont exit the shop in 30 second you will be removed.");
}
if (strcmp(cmd, "/100hp", true) == 0) {
if (inshop[playerid] == 1) {
if (GetPlayerMoney(playerid) >= 1000) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name, sizeof(name));
format(string, sizeof(string), "- %s recharged his healtbar for 1000$. -",name);
SetPlayerHealth(playerid, 100);
SendClientMessageToAll(0xFF8A00AA,string);
TogglePlayerControllable(playerid,1);
SetPlayerPos(playerid,2559.2009,-1285.5802,1054.6406);
GivePlayerMoney(playerid, -1000);
inshop[playerid] = 0;
KillTimer(remove);
return 1;
} else {
SendClientMessage(playerid, 0xFF8A00AA, "You dont have enough money! Kill to earn and come back!.");
}
}
}
if (strcmp(cmd, "/sawnoff", true) == 0) {
if (inshop[playerid] == 1) {
if (GetPlayerMoney(playerid) >= 2000) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name, sizeof(name));
format(string, sizeof(string), "- %s bought a Sawn Off Shotgun for 2000$. -",name);
GivePlayerWeapon(playerid, 26, 90);
SendClientMessageToAll(0xFF8A00AA,string);
TogglePlayerControllable(playerid,1);
SetPlayerPos(playerid,2559.2009,-1285.5802,1054.6406);
GivePlayerMoney(playerid, -2000);
inshop[playerid] = 0;
KillTimer(remove);
return 1;
} else {
SendClientMessage(playerid, 0xFF8A00AA, "You dont have enough money! Kill to earn and come back!.");
}
}
}
if (strcmp(cmd, "/exit", true) == 0) {
if (inshop[playerid] == 1) {
SetPlayerPos(playerid,2559.2009,-1285.5802,1054.6406);
TogglePlayerControllable(playerid,1);
inshop[playerid] = 0;
KillTimer(remove);
return 1;
}
}
return 0;
}
//-------------------------------------------------------------------------
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
//-------------------------------------------------------------------------
public ExitShop(playerid)
{
SendClientMessage(playerid, 0xFF8A00AA, "You got removed from shop! Dont use the shop like a n00b!");
SetPlayerPos(playerid,2559.2009,-1285.5802,1054.6406);
TogglePlayerControllable(playerid,1);
inshop[playerid] = 0;
KillTimer(remove);
}
//-------------------------------------------------------------------------
public SetupPlayerForWinScanner(playerid) {
new name[MAX_PLAYER_NAME];
new tmp[256];
GetPlayerName(playerid,name, sizeof(name));
format(tmp,sizeof(tmp), "~r~%s ~r~is the ~n~~r~WINNER!!!; -",name);
GameTextForAll(tmp,5000,6);
SetTimer("GameModeExitFunc", 5000, 0);
TogglePlayerControllable(playerid, 0);
}
//-------------------------------------------------------------------------
public EndOfGamemode(playerid) {
if(GetPlayerScore(0) > GetPlayerScore(1 || 2 || 3 || 4 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(1) > GetPlayerScore(0 || 2 || 3 || 4 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(2) > GetPlayerScore(0 || 1 || 3 || 4 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(3) > GetPlayerScore(0 || 1 || 2 || 4 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(4) > GetPlayerScore(0 || 1 || 2 || 3 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(5) > GetPlayerScore(0 || 1 || 2 || 3 || 4 || 6)) {
SetupPlayerForWinScanner(playerid);
}
if(GetPlayerScore(6) > GetPlayerScore(0 || 1 || 2 || 3 || 5 || 6)) {
SetupPlayerForWinScanner(playerid);
}
return 1;
}
//-------------------------------------------------------------------------
public GameModeExitFunc() {
GameModeExit(); }