Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Forum Samp *
- ********************************************
- Sistema de Invadir DP e Explodir Celas
- By: Life_Advanced
- Não Retira os Créditos Aproveita !
- *********************************************
- */
- //*********************
- #include a_samp
- #include zcmd
- // Os Codigos pode ta meio estranho mais vai dar pra entender um Pouco !
- //*********************
- new explodiracela[MAX_PLAYERS];
- new invadirporta[MAX_PLAYERS];
- new PortaoDP;
- new cela1;
- new cela2;
- //**************************
- forward InvadirPortao(playerid);
- forward UsarPorta(playerid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward PortaoReformado();
- forward explodircela1(playerid);
- forward explodircela2(playerid);
- forward UsarCela(playerid);
- forward reformarcela1();
- forward reformarcela2();
- //*********************
- #define ForPlayers(%1) for(new %1 = 0; %1 < MAX_PLAYERS; %1++) if(IsPlayerConnected(%1) && !IsPlayerNPC(%1))
- //*******************
- public OnFilterScriptInit()
- {
- print("\n(*********************************************)");
- print(" Sistema de Explodir e Invadir DP: Life_Advanced ");
- print(" Não retire os créditos !! ");
- print("(*********************************************)\n");
- //*********
- PortaoDP = CreateObject( 985 , 247.005905 , 72.448440 , 1003.640625 , 0.000000 , 0.000000 , 1260.000000 );
- //*********
- Create3DTextLabel("Para invadir a DP\n{FF0000}/invadirdp",-1,245.24836731,72.30346680,1004.05560303,7.0,0);
- //*********
- CreateObject(1654,245.24836731,72.30346680,1004.05560303,0.00000000,0.00000000,0.00000000);
- //*********
- Create3DTextLabel("Para explodir a cela\n{FF0000}/explodircelas",-1,266.41387939,88.43037415,1001.51251221,7.0,0);
- //*********
- Create3DTextLabel("Para explodir a cela\n{FF0000}/explodircelas",-1,266.39843750,83.92252350,1001.50115967,7.0,0);
- //*********
- cela1 = CreateObject(2930,266.37335205,83.79895782,1002.67590332,0.00000000,0.00000000,0.00000000);
- //*********
- cela2 = CreateObject(2930,266.36856079,88.33088684,1002.67590332,0.00000000,0.00000000,0.00000000);
- //*********
- CreateObject(1654,245.24836731,72.30346680,1004.05560303,0.00000000,0.00000000,0.00000000);
- //*********
- CreateObject(1654,266.41387939,88.43037415,1001.51251221,0.00000000,0.00000000,84.92492676);
- //*********
- CreateObject(1654,266.39843750,83.92252350,1001.50115967,0.00000000,0.00000000,84.92431641);
- return 1;
- }
- //**************************[ Invadir DP ]************************
- CMD:invadirdp(playerid, params[]) // By: Life
- {
- new string[100];
- if(invadirporta[playerid] == 1) return SendClientMessage(playerid, -1, "Você já invadiu a DP, deve esperar 1 Minuto.");
- if(!PlayerToPoint(15.0, playerid, 247.005905,72.448440,1003.640625)) return SendClientMessage(playerid, -1, "Não está no local Certo pra Invadir DP !");
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}está tentando invadir a DP",Nome(playerid));
- SendClientMessageToAll(-1, string);
- SendClientMessage(playerid, -1, "Aguarde 10 Segundos para invadir a DP.");
- SetTimerEx("InvadirPortao", 10000, 0, "i", playerid); // 10 Segundos !!!
- SetTimer("UsarPorta", 60000, 0); // 60 Segundos !!!
- invadirporta[playerid] = 1;
- return 1;
- }
- CMD:ls(playerid, params[])
- {
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Não está connectado pra usar esse comando !");
- SetPlayerPos(playerid, 1539.6094,-1694.4749,13.5469);
- SendClientMessage(playerid, -1, "DP/LS {FF00FF}Pronto !");
- SetPlayerInterior(playerid, 0);
- return 1;
- }
- //*****************[ Explodir Celas ]******************* // Arrume da sua vontade !
- CMD:explodircelas(playerid, params[])
- {
- new string[100];
- if (explodiracela[playerid] == 1) return SendClientMessage(playerid, -1, "Você já explodiu a cela, deve esperar 3 minutos.");
- if(PlayerToPoint(15.0, playerid, 266.37335205,83.79895782,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}está explodindo a cela nº1",Nome(playerid));
- SendClientMessageToAll(-1, string);
- SendClientMessage(playerid, -1, "Aguarde 10 Segundos para explodir a cela.");
- SetTimerEx("explodircela1", 10000, 0, "i", playerid); // 10 Segundos pra ...
- SetTimer("UsarCela", 60000, 0); // Explodir Nova.... 60 segundos = 1 Minuto
- explodiracela[playerid] = 1;
- return 1;
- }
- else if(PlayerToPoint(15.0, playerid, 266.36856079,88.33088684,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}está explodindo a cela nº2",Nome(playerid));
- SendClientMessageToAll(-1, string);
- SendClientMessage(playerid, -1, "Aguarde 10 Segundos para explodir a cela.");
- SetTimerEx("explodircela2", 10000, 0, "i", playerid); // 10 Segundos ...
- SetTimer("UsarCela", 60000, 0); // Explodir Nova.... 60 segundos = 1 Minuto
- explodiracela[playerid] = 1;
- return 1;
- }
- return 1;
- }
- //******************************
- 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 0;
- }
- //*****************************
- stock Nome(playerid)
- {
- new Name[MAX_PLAYERS];
- GetPlayerName(playerid, Name, sizeof(Name));
- return Name;
- }
- //****************************
- public UsarPorta(playerid)
- {
- invadirporta[playerid] = 0;
- }
- //*************************
- public explodircela1(playerid)
- {
- new string[256];
- if(!PlayerToPoint(30.0, playerid, 266.37335205,83.79895782,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}não conseguiu explodir a cela.",Nome(playerid));
- SendClientMessageToAll(-1, string);
- explodiracela[playerid] = 1;
- return 1;
- }
- ForPlayers(i)
- {
- if(PlayerToPoint(30.0, playerid, 266.37335205,83.79895782,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}conseguiu explodir a cela.",Nome(playerid));
- SendClientMessageToAll(-1, string);
- DestroyObject(cela1);
- CreateExplosion(266.37335205,83.79895782,1002.67590332,12,1.0);
- explodiracela[playerid] = 1;
- SetTimer("reformarcela1", 30000, 0);
- return 1;
- }
- }
- return 1;
- }
- //****************************
- public explodircela2(playerid)
- {
- new playername[MAX_PLAYER_NAME];
- new string[256];
- GetPlayerName(playerid,playername,sizeof(playername));
- if(!PlayerToPoint(30.0, playerid, 266.36856079,88.33088684,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}não conseguiu explodir a cela.",playername);
- SendClientMessageToAll(-1, string);
- explodiracela[playerid] = 1;
- return 1;
- }
- ForPlayers(i)
- {
- if(PlayerToPoint(30.0, playerid, 266.36856079,88.33088684,1002.67590332))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}conseguiu explodir a cela.",playername);
- SendClientMessageToAll(-1, string);
- DestroyObject(cela2);
- CreateExplosion(266.36856079,88.33088684,1002.67590332,12,1.0);
- explodiracela[playerid] = 1;
- SetTimer("reformarcela2", 30000, 0);
- return 1;
- }
- }
- return 1;
- }
- //*************************
- public InvadirPortao(playerid)
- {
- new string[256];
- if(!PlayerToPoint(30.0, playerid, 247.005905,72.448440,1003.640625))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}não conseguiu invadir a DP",Nome(playerid));
- SendClientMessageToAll(-1, string);
- invadirporta[playerid] = 1;
- return 1;
- }
- ForPlayers(i)
- {
- if(PlayerToPoint(30.0, playerid, 247.005905,72.448440,1003.640625))
- {
- format(string, sizeof(string), "O{89898b} %s {f5f3f0}invadiu a DP",Nome(playerid));
- SendClientMessageToAll(-1, string);
- DestroyObject(PortaoDP);
- DestroyObject(PortaoDP);
- CreateExplosion(247.005905,72.448440,1003.640625,12,1.0);
- invadirporta[playerid] = 1;
- SetTimer("PortaoReformado", 30000, 1); // 30 Segundos !!!
- return 1;
- }
- }
- return 1;
- }
- //***********************
- public PortaoReformado()
- {
- PortaoDP = CreateObject(985,247.005905,72.448440,1003.640625,0,0,0);
- SendClientMessageToAll(0x33FF00FF, "Portao Reformado");
- }
- //***********************
- public UsarCela(playerid)
- {
- explodiracela[playerid] = 0;
- }
- //********************
- public reformarcela1()
- {
- cela1 = CreateObject(2930,266.37335205,83.79895782,1002.67590332,0.00000000,0.00000000,0.00000000);
- SendClientMessageToAll(0x33FF00FF, "Cela Reformada");
- }
- //*******************
- public reformarcela2()
- {
- cela2 = CreateObject(2930,266.36856079,88.33088684,1002.67590332,0.00000000,0.00000000,0.00000000);
- SendClientMessageToAll(0x33FF00FF, "Cela Reformada");
- }
- //*****************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement