Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define COLOR_YELLOWGREEN 0x9ACD32AA
- #define COLOR_LIGHTRED 0xFF6347AA
- new animLocked[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Crack System by Ricardo Rodrigues");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- if(animLocked[forplayerid] == 1)
- {
- RemovePlayerFromVehicle(forplayerid);
- ApplyAnimation(forplayerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 0, 1);
- return 1;
- }
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- new Float:hp;
- GetPlayerHealth(playerid, hp);
- if(hp <= 80 && animLocked[playerid] == 0)
- {
- for(new i = 0; i < MAX_VEHICLES; i++)
- SetVehicleParamsForPlayer(i, playerid, 0, 1);
- animLocked[playerid] = 1;
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 0, 1);
- return 1;
- }
- return 0;
- }
- CMD:cure(playerid, params[])
- {
- new id;
- if(!sscanf(params, "u", id))
- {
- new Float:px, Float:py, Float:pz;
- GetPlayerPos(id, px, py, pz);
- if(IsPlayerInRangeOfPoint(playerid, 5.0, Float:px, Float:py, Float:pz))
- {
- TogglePlayerControllable(id, 1);
- animLocked[playerid] = 0;
- SendClientMessage(id, COLOR_YELLOWGREEN, "You have been cured by a medic.");
- SendClientMessage(playerid, COLOR_YELLOWGREEN, "You have just cured him. Good job.");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not close to the player you are trying to heal.");
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /cure [PlayerID/PartOfName]");
- }
- CMD:acure(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new id;
- if(!sscanf(params, "u", id))
- {
- TogglePlayerControllable(id, 1);
- animLocked[playerid] = 0;
- SendClientMessage(id, COLOR_YELLOWGREEN, "You have been cured by an admin.");
- SendClientMessage(playerid, COLOR_YELLOWGREEN, "You have just cured him.");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /acure [PlayerID/PartOfName]");
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to be logged in with RCON in order to use this command.");
- }
Add Comment
Please, Sign In to add comment