Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <core>
- #include <float>
- #include <zcmd>
- #pragma tabsize 0
- #define COLOR_LIGHTRED 0xFF6347AA // 0xB33C3CAA
- #define COL_RED "{B33C3C}"
- new Text3D:deathlabel[MAX_PLAYERS];
- new bool:isAlive[MAX_PLAYERS];
- new bool:stopanimAllowed[MAX_PLAYERS];
- new Float:Deadx[MAX_PLAYERS], Float:Deady[MAX_PLAYERS], Float:Deadz[MAX_PLAYERS];
- new deadvw[MAX_PLAYERS];
- new deadint[MAX_PLAYERS];
- new oldskin[MAX_PLAYERS];
- new killed[MAX_PLAYERS];
- enum pInfo
- {
- pWeapon1,
- pWeapon2,
- pWeapon3,
- pWeapon4,
- pWeapon5,
- pWeapon6,
- pWeapon7,
- pWeapon8,
- pWeapon9,
- pWeapon10,
- pWeapon11,
- pWeapon12,
- pWeapon13,
- pWeapon14
- }
- enum E_SHOT_INFO
- {
- Chest,
- Crotch,
- LArm,
- RArm,
- LLeg,
- RLeg,
- Head,
- Misc
- }
- new sInfo[MAX_PLAYERS][E_SHOT_INFO];
- forward ResetPlayerStats(playerid);
- forward OperationDone(playerid);
- main()
- {
- print("\n----------------------------------");
- print(" Bare Script\n");
- print("----------------------------------\n");
- }
- public OnPlayerConnect(playerid)
- {
- GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
- ResetPlayerStats(playerid);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new idx;
- new cmd[256];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/yadayada", true) == 0) {
- return 1;
- }
- return 0;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerInterior(playerid,0);
- TogglePlayerClock(playerid,0);
- sInfo[playerid][Misc] = 0;
- sInfo[playerid][Head] = 0;
- sInfo[playerid][Chest] = 0;
- sInfo[playerid][Crotch] = 0;
- sInfo[playerid][LArm] = 0;
- sInfo[playerid][RArm] = 0;
- sInfo[playerid][LLeg] = 0;
- sInfo[playerid][RLeg] = 0;
- isAlive[playerid] == true;
- if(isAlive[playerid] == false)
- {
- SetPlayerPos(playerid, Deadx[playerid], Deady[playerid], Deadz[playerid]);
- SetPlayerInterior(playerid, deadint[playerid]);
- SetPlayerVirtualWorld(playerid, deadvw[playerid]);
- stopanimAllowed[playerid] = false;
- SendClientMessage(playerid, COLOR_LIGHTRED, "You're currently brutally wounded. If no-one helps you, you will die. /acceptdeath if you wish to give up.");
- TogglePlayerControllable(playerid,0);
- SetTimerEx("LoadDeathAnim", 1000, false, "i", playerid);
- SetPlayerSkin(playerid, oldskin[playerid]);
- for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
- new string[400];
- new holder[400];
- if(sInfo[playerid][Misc] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d bruises on their body.\n", sInfo[playerid][Misc]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][Head] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n", sInfo[playerid][Head]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][Chest] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n", sInfo[playerid][Chest]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][Crotch] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n", sInfo[playerid][Crotch]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][LArm] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n", sInfo[playerid][LArm]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][RArm] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n", sInfo[playerid][RArm]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][LLeg] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n", sInfo[playerid][LLeg]);
- strcat(holder, string, sizeof(holder));
- }
- if(sInfo[playerid][RLeg] > 0)
- {
- format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n", sInfo[playerid][RLeg]);
- strcat(holder, string, sizeof(holder));
- }
- deathlabel[playerid] = Create3DTextLabel(holder, -1, Deadx[playerid], Deady[playerid], Deadz[playerid], 10.0, 0, 0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- isAlive[playerid] = false;
- return 1;
- }
- SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,14);
- SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
- SetPlayerFacingAngle(playerid, 270.0);
- SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
- SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetupPlayerForClassSelection(playerid);
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- new Float:HP;
- GetPlayerHealth(playerid, HP);
- if(weaponid == 4) SetPlayerHealth(playerid, HP-30);
- if(weaponid == 22) SetPlayerHealth(playerid, HP-25);
- if(weaponid == 32) SetPlayerHealth(playerid, HP-25);
- if(weaponid == 28) SetPlayerHealth(playerid, HP-25);
- if(weaponid == 30) SetPlayerHealth(playerid, HP-30);
- if(weaponid == 31) SetPlayerHealth(playerid, HP-21);
- if(weaponid == 34) SetPlayerHealth(playerid, HP-70);
- if(weaponid == 29) SetPlayerHealth(playerid, HP-25);
- if(weaponid == 25) SetPlayerHealth(playerid, HP-40);
- if(!IsPlayerConnected(playerid)) return 0;
- if(!IsPlayerConnected(issuerid)) return 0;
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(weaponid == 0 || weaponid == 1 || weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 ||
- weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 15)
- {
- sInfo[playerid][Misc] += 1;
- SendClientMessage(playerid, -1, "ai tras in misc si i-ai luat ");
- }
- }
- if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
- {
- SetPlayerHealth(playerid, 0.0);
- SendClientMessage(playerid, -1, "ai tras in cap cu sniper si i-ai luat ");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 3)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][Chest] += 1;
- SendClientMessage(playerid, -1, "ai tras in chest si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 4)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][Crotch] += 1;
- SendClientMessage(playerid, -1, "ai tras in croatch si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 5)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][LArm] += 1;
- SendClientMessage(playerid, -1, "ai tras in l arm si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 6)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][RArm] += 1;
- SendClientMessage(playerid, -1, "ai tras in arm r si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 7)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][LLeg] += 1;
- SendClientMessage(playerid, -1, "ai tras in picor light si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 8)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- sInfo[playerid][RLeg] += 1;
- SendClientMessage(playerid, -1, "ai tras in picior right si i-ai luat ");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- if(issuerid != INVALID_PLAYER_ID && bodypart == 9)
- {
- if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
- weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
- {
- SetPlayerHealth(playerid, HP-70);
- sInfo[playerid][Head] += 1;
- SendClientMessage(playerid, -1, "ai tras in cap si i-ai luat");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "nu ia damage");
- }
- return 1;
- }
- public OnGameModeInit()
- {
- SetGameModeText("Bare Script");
- ShowPlayerMarkers(1);
- ShowNameTags(1);
- AllowAdminTeleport(1);
- AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
- return 1;
- }
- public ResetPlayerStats(playerid)
- {
- sInfo[playerid][Misc] = 0;
- sInfo[playerid][Head] = 0;
- sInfo[playerid][Chest] = 0;
- sInfo[playerid][Crotch] = 0;
- sInfo[playerid][LArm] = 0;
- sInfo[playerid][RArm] = 0;
- sInfo[playerid][LLeg] = 0;
- sInfo[playerid][RLeg] = 0;
- isAlive[playerid] = true;
- }
- 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 OperationDone(playerid)
- {
- // FadeColorForPlayer(playerid,0,0,0,255,0,0,0,0,15,0);
- SendClientMessage(playerid, -1, "You have been treated at the hospital. The hospital bill is $50.");
- SetPlayerPos(playerid, 2034.1787,-1401.6705,17.2949);
- GivePlayerMoney(playerid, -50);
- SetPlayerHealth(playerid, 90.0);
- ClearAnimations(playerid);
- TogglePlayerControllable(playerid, 1);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- CMD:acceptdeath(playerid, params[])
- {
- if(isAlive[playerid] == false)
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have been rushed to the hospital and are undergoing an operation.");
- SetPlayerPos(playerid, -211.3207,-1759.6207,676.7153);
- SetPlayerInterior(playerid, 3);
- SetPlayerVirtualWorld(playerid, 0);
- // FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
- SetTimerEx("OperationDone", 15000, false, "i", playerid);
- isAlive[playerid] = true;
- //ApplyPlayerAnimation(playerid,"CRACK","crckdeth1",4.1,1,1,1,1,1,1);
- Delete3DTextLabel(deathlabel[playerid]);
- sInfo[playerid][Chest] = 0;
- sInfo[playerid][Head] = 0;
- sInfo[playerid][Crotch] = 0;
- sInfo[playerid][RLeg] = 0;
- sInfo[playerid][LLeg] = 0;
- sInfo[playerid][RArm] = 0;
- sInfo[playerid][LArm] = 0;
- killed[playerid] = 0;
- }
- else
- {
- SendClientMessage(playerid, -1, "nu merge bos");
- }
- return 1;
- }
- CMD:m4(playerid, params[])
- {
- GivePlayerWeapon(playerid, 31, 999);
- return 1;
- }
- CMD:sniper(playerid, params[])
- {
- GivePlayerWeapon(playerid, 34, 999);
- return 1;
- }
- CMD:grenade(playerid, params[])
- {
- GivePlayerWeapon(playerid,16,999);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment