Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- //------------------------------------------------------------------------------
- //==================[Script Facut de NoNamed pentru SA-MP.Ro]===================
- //------------------[Te Rog Sa Pastrezi Creditele Scriptului]-------------------
- //==============================================================================
- //------------------------------------------------------------------------------
- //===========================[Includes]=========================================
- #include <a_samp>
- #include <streamer>
- //===========================[Includes]=========================================
- //============================[Defines]=========================================
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_PURPLE 0xC2A2DAAA
- //============================[Defines]=========================================
- //==============================[New's]=========================================
- new Float:ax, Float:ay, Float:az;
- new bomb[MAX_PLAYERS];
- //==============================[New's]=========================================
- //===========================[Forwards]=========================================
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5);
- forward Explosion();
- //===========================[Forwards]=========================================
- public OnFilterScriptInit()
- {
- print("\n---------------------------------------------------");
- print(" Magazin de Bombe - Scriptat de NoNamed");
- print("-----------------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- //============================[Comenzi]=========================================
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/bombshop", cmdtext, true, 10) == 0)
- {
- SetPlayerCheckpoint(playerid, 1913.3884,-1070.5337,24.2487, 3.0);
- SendClientMessage(playerid, COLOR_WHITE, "Mergi la {FF0000}checkpoint-ul rosu {FFFFFF}de pe harta !");
- return 1;
- }
- if (strcmp("/buybomb", cmdtext, true, 10) == 0)
- {
- if(PlayerToPoint(5.0, playerid, 1913.3884,-1070.5337,24.2487))
- {
- if(bomb[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nu poti lua mai mult de o bomba !");
- return 1;
- }
- else
- {
- bomb[playerid] += 1;
- GivePlayerMoney(playerid, -5000);
- SendClientMessage(playerid, COLOR_WHITE, "Ai cumparat o {FF0000} bomba {FFFFFF}pentru pretul de {FF0000} $5000{FFFFFF}.");
- SendClientMessage(playerid, COLOR_WHITE, "Foloseste {FF0000} /plantbomb {FFFFFF}pentru a planta bomba normal.");
- SendClientMessage(playerid, COLOR_WHITE, "Foloseste {FF0000}/silentbomb {FFFFFF} pentru a planta bomba pe ascuns.");
- }
- }
- return 1;
- }
- if (strcmp("/plantbomb", cmdtext, true, 10) == 0)
- {
- new playername[MAX_PLAYER_NAME],string[128];
- GetPlayerPos(playerid, ax,ay,az);
- if(bomb[playerid] == 1)
- {
- ApplyAnimation(playerid, "BOMBER", "BOM_PLANT", 4.1, 0, 0, 0, 0, 0);
- SetTimer("Explosion", 10000, false);
- bomb[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Ai plantat bomba, aceasta explodeaza in 10 secunde !");
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), "%s a plantat o bomba, e cazul sa fugiti!", playername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nu ai o bomba ca sa o plantezi .");
- }
- return 1;
- }
- if (strcmp("/silentbomb", cmdtext, true, 10) == 0)
- {
- GetPlayerPos(playerid, ax,ay,az);
- if(bomb[playerid] == 1)
- {
- ApplyAnimation(playerid, "BOMBER", "BOM_PLANT", 4.1, 0, 0, 0, 0, 0);
- SetTimer("Explosion", 10000, false);
- bomb[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Ai plantat bomba, aceasta explodeaza in 10 secunde !");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nu ai o bomba ca sa o plantezi .");
- }
- return 1;
- }
- return 0;
- }
- //============================[Comenzi]=========================================
- //============================[Checkpoint-uri]==================================
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(PlayerToPoint(3.0, playerid, 1913.3884,-1070.5337,24.2487))
- {
- SendClientMessage(playerid, COLOR_WHITE, "Ai ajuns la destinatie! Foloseste {FF0000}/buybomb{FFFFFF}.");
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- //============================[Checkpoint-uri]==================================
- //=============================[Alte Functii]===================================
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, str);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, str);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, str);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, str);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, str);
- }
- }
- }
- }//not connected
- return 1;
- }
- public Explosion()
- {
- CreateExplosion(ax, ay, az, 11, 5000);
- }
- //=============================[Alte Functii]===================================
- /*Scriptat si creat de NoNamed ! Copyright © NoNamed , All Rights Reserved!*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement