Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Canli bomba sistemi By mR.LuxuRy~
- */
- //--[Include]--
- #include <a_samp>
- //--[enum]--
- enum bomba
- {
- Kuruldumu,
- Alindimi,
- }
- //--[new]--
- new oBilgi[MAX_PLAYERS][bomba];
- new patlayici;
- new bomba1;
- //--[forward]--
- forward patlama(playerid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- //------------------------------------------------------------------------------
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Canli bomba sistemi By mR.LuxuRy~");
- print("--------------------------------------\n");
- return true;
- }
- //------------------------------------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bu server mR.LuxuRy'nin canli bomba sistemini kullanmaktadir. Daha fazla bilgi i�in /bombayardim.");
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- if (strcmp("/bombayardim", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0x7FFF00AA,"~mR.LuxuRy' nin canli bomba sistemi yardim menusu~");
- SendClientMessage(playerid,0x7FFF00AA,"Silah�iya giderek /bombaal yazip bomba alabilirsiniz.");
- SendClientMessage(playerid,0x7FFF00AA,"Bombanizi aldiktan sonra, �st�n�ze kurmaniz gerekmektedir.");
- SendClientMessage(playerid,0x7FFF00AA,"Bombayi kurmak i�in, /bombakur yaziniz.");
- SendClientMessage(playerid,0x7FFF00AA,"Artik hersey tamam. Birtek patlatmak kaldi geriye.");
- SendClientMessage(playerid,0x7FFF00AA,"İnsanlarin toplu oldugu gidin ve /bombapatlat yazarak bombayi patlatin.");
- return true;
- }
- if (strcmp("/bombaal", cmdtext, true, 10) == 0)
- {
- //Silahcida mi, degil mi kontrol ediyor.
- if(PlayerToPoint(50,playerid,286.148987,-40.644398,1001.569946) || PlayerToPoint(50,playerid,286.800995,-82.547600,1001.539978) || PlayerToPoint(50,playerid,296.919983,-108.071999,1001.569946) || PlayerToPoint(50,playerid,314.820984,-141.431992,999.661987) || PlayerToPoint(50,playerid,316.524994,-167.706985,999.661987) || PlayerToPoint(50,playerid,302.292877,-143.139099,1004.062500) || PlayerToPoint(50,playerid,280.795104,-135.203353,1004.062500))
- {
- //Alindi mi?
- if(oBilgi[playerid][Alindimi] == 1)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bombayi zaten aldin!");
- return false;
- }
- //Kuruldu mu?
- else if(oBilgi[playerid][Kuruldumu] == 1)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
- return false;
- }
- //Parasi var mi?
- else if(GetPlayerMoney(playerid) >= 1500)
- {
- //Alindi mi?
- if(oBilgi[playerid][Alindimi] == 1)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bombayi zaten aldin!");
- return false;
- }
- //Kuruldu mu?
- else if(oBilgi[playerid][Kuruldumu] == 1)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
- return false;
- //Eger varsa.
- }else{
- oBilgi[playerid][Alindimi] = 1;
- GivePlayerMoney(playerid,-1500);
- GameTextForPlayer(playerid,"~g~~h~~h~-1500",3000,1);
- SendClientMessage(playerid,0x7FFF00AA,"Bombayi satin aldin. /bombakur yazarak bombayi kurabilirsin.");
- }
- //Eger yoksa.
- }
- else
- {
- SendClientMessage(playerid,0x7FFF00AA,"Paran yok!");
- }
- //Silah�ida degilse.
- }
- else
- {
- SendClientMessage(playerid,0x7FFF00AA,"Silah�ida degilsin!");
- }
- return true;
- }
- //------------------------------------------------------------------------------
- if (strcmp("/bombakur", cmdtext, true, 10) == 0)
- {
- //Kuruldu mu?
- if(oBilgi[playerid][Kuruldumu] == 1)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
- return false;
- }
- //Alindi mi?
- else if(oBilgi[playerid][Alindimi] == 1)
- {
- //Kurulmadi mi?
- if(oBilgi[playerid][Kuruldumu] == 0)
- {
- oBilgi[playerid][Kuruldumu] = 1;
- bomba1 = CreateObject(1252,X,Y,Z,0,0,0);
- AttachObjectToPlayer(bomba1,playerid,1.5, 0, 0, 0, 0, 0);
- SendClientMessage(playerid,0x7FFF00AA,"Bombayi kurdun! /bombapatlat yazarak bombayi patlatabilirsin!");
- return true;
- }
- //Alinmadi mi?
- }
- else
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomban yok!");
- }
- return true;
- }
- //------------------------------------------------------------------------------
- if (strcmp("/bombapatlat", cmdtext, true, 10) == 0)
- {
- //Kurulmadi mi?
- if(oBilgi[playerid][Kuruldumu] == 0)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomba kurulu degil!");
- return false;
- }
- //Alinmadi mi?
- else if(oBilgi[playerid][Alindimi] == 0)
- {
- SendClientMessage(playerid,0x7FFF00AA,"Bomban yok!");
- return false;
- //Alindi ve kurulmadi ise.
- }
- else
- {
- oBilgi[playerid][Kuruldumu] = 0;
- oBilgi[playerid][Alindimi] = 0;
- DestroyObject(bomba1);
- SetTimerEx("patlama",1000,true,"i",playerid);
- return true;
- }
- }
- return false;
- }
- //------------------------------------------------------------------------------
- public patlama(playerid)
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- patlayici++;
- if(patlayici == 0)
- {
- CreateExplosion(X,Y+5,Z,7,15);
- return true;
- }
- if(patlayici == 1)
- {
- CreateExplosion(X+5,Y,Z,7,15);
- return true;
- }
- if(patlayici == 2)
- {
- CreateExplosion(X,Y,Z+5,7,15);
- return true;
- }
- if(patlayici == 3)
- {
- CreateExplosion(X,Y,Z,7,15);
- return true;
- }
- if(patlayici == 4)
- {
- CreateExplosion(X+5,Y+5,Z+5,7,15);
- return true;
- }
- return true;
- }
- //------------------------------------------------------------------------------
- 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 true;
- }
- }
- return false;
- }
- //----------------------------------SON-----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement