Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- xProtection - Spawn Koruması
- by XpDeviL | www.xpdevil.com
- Özellikler:
- * Oyuncu spawn olunca 10 saniyelik bir korumaya sahip olur.
- * Eğer oyuncu hareket eder veya ateş ederse koruma iptal olur.
- * Spawn koruması olan oyuncuyu vuran oyuncuya, spawn koruması olduğuna dair mesaj gider.
- */
- #include <a_samp>
- enum xsp
- {
- protected,
- protectTimer,
- };
- new xProtection[MAX_PLAYERS][xsp];
- public OnFilterScriptInit()
- {
- print("\n+-----------------------------------------------------------+");
- print("| |");
- print("| xProtection - Spawn Koruması ! Yüklendi ! |");
- print("| |");
- print("+----------------------------------------------+------------+");
- print(" | by XpDeviL |");
- print(" +------------+");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- xProtection[playerid][protected] = 1;
- SetPlayerHealth(playerid, 65535.0);
- SetPlayerAttachedObject(playerid, 9, 18741, 1, -1.075000, 0.019999, -1.651001, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- xProtection[playerid][protectTimer] = SetTimerEx("EndProtect", 10000, false, "d", playerid);
- SendClientMessage(playerid, -1, "{00FF00}[!] {00FFB3}10 saniyelik spawn koruması aktifleştirildi! Hareket ederseniz koruma sona eder.");
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(xProtection[playerid][protected] == 1)
- {
- new Keys,ud,lr;
- GetPlayerKeys(playerid,Keys,ud,lr);
- if(ud == KEY_UP || ud == KEY_DOWN || lr == KEY_LEFT || lr == KEY_RIGHT || Keys == KEY_JUMP)
- {
- SendClientMessage(playerid, -1, "{FF0000}[!] {FFA500}Hareket ettiğiniz için spawn koruması sona erdi!");
- EndProtection(playerid);
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(xProtection[playerid][protected] == 1)
- {
- SendClientMessage(playerid, -1, "{FF0000}[!] {FFA500}Ateş ettiğiniz için spawn koruması sona erdi!");
- EndProtection(playerid);
- }
- if(hittype == BULLET_HIT_TYPE_PLAYER)
- {
- if(xProtection[hitid][protected] == 1)
- {
- SendClientMessage(playerid, -1, "{FF0000}[!] {FFA500}Ateş ettiğiniz oyuncunun spawn koruması var!");
- }
- }
- return 1;
- }
- forward EndProtect(playerid);
- public EndProtect(playerid)
- {
- EndProtection(playerid);
- SendClientMessage(playerid, -1, "{FF0000}[!] {FFA500}Spawn korumanız sona erdi!");
- return 1;
- }
- forward EndProtection(playerid);
- public EndProtection(playerid)
- {
- xProtection[playerid][protected] = 0;
- SetPlayerHealth(playerid, 100.0);
- RemovePlayerAttachedObject(playerid, 9);
- KillTimer(xProtection[playerid][protectTimer]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement