Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*VISITE NOSSO SITE: http://www.sampknd.com/
- SAMP KND MELOR BLOG DE SAMP DO BRASIL
- */
- #include a_samp
- #include DOF2
- #include zcmd
- #define bombasd "Bombas\\%s.ini"
- #define msgb "Você ainda tem %d bombas."
- new qtdb[MAX_PLAYERS];
- new bobj[MAX_PLAYERS];
- new nome[25];
- new Float:cds[3];
- new bool:plantando[MAX_PLAYERS];
- new bfile[35];
- new bindicador[60];
- stock salvardados(playerid)
- {
- GetPlayerName(playerid,nome,24);
- format(bfile,sizeof bfile,bombasd,nome);
- DOF2_SetInt(bfile,"bombas",GetPVarInt(playerid,"bombas"));
- DOF2_SaveFile();
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("O sistema de bombas de FROSTGF foi carregado");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("O sistema de bombas de FROSTGF foi descarregado");
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid,nome,sizeof nome);
- format(bfile,sizeof bfile,bombasd,nome);
- if(!fexist(bfile))
- {
- DOF2_CreateFile(bfile);
- DOF2_SetInt(bfile,"bombas",GetPVarInt(playerid,"bombas"));
- DOF2_SaveFile();
- plantando[playerid] = false;
- }
- else return SetPVarInt(playerid,"bombas",DOF2_GetInt(bfile,"bombas"));
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- salvardados(playerid);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- GetPlayerName(playerid,nome,24);
- if(dialogid == 1)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) >= 3500)
- {
- GetPlayerName(playerid,nome,sizeof nome);
- format(bfile,sizeof bfile,bombasd,nome);
- SetPVarInt(playerid,"bombas",++qtdb[playerid]);
- SendClientMessage(playerid,-1,"Bomba adquirida com sucesso.");
- GivePlayerMoney(playerid,-3500);
- salvardados(playerid);
- }
- else return SendClientMessage(playerid,-1,"Você não tem dinheiro suficiente para comprar uma bomba(R$3500,00).");
- }
- if(listitem == 1)
- {
- if(GetPVarInt(playerid,"bombas") >= 1)
- {
- format(bindicador,sizeof bindicador,msgb,GetPVarInt(playerid,"bombas")-1);
- GetPlayerName(playerid,nome,sizeof nome);
- format(bfile,sizeof bfile,bombasd,nome);
- SetPVarInt(playerid,"bombas",--qtdb[playerid]);
- GivePlayerMoney(playerid,3100);
- SendClientMessage(playerid,-1,bindicador);
- salvardados(playerid);
- }
- else return SendClientMessage(playerid,-1,"Você não tem bombas para vender.");
- }
- if(listitem == 2)
- {
- if(GetPVarInt(playerid,"bombas") >= 1)
- {
- format(bindicador,sizeof bindicador,msgb,GetPVarInt(playerid,"bombas"));
- SendClientMessage(playerid,-1,bindicador);
- }
- else return SendClientMessage(playerid,-1,"Você não possui bombas, para comprar bombas use: /bombamenu");
- }
- return 1;
- }
- return 1;
- }
- return 1;
- }
- CMD:bombamenu(playerid,params[]) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Menu","Comprar bomba - R$3500,00\nVender bomba - R$3100,00\nVer minhas bombas","Ok","Fechar");
- CMD:detonar(playerid,params[])
- {
- if(plantando[playerid] == true)
- {
- format(bfile,sizeof bfile,bombasd,nome);
- format(bindicador,sizeof bindicador,msgb,GetPVarInt(playerid,"bombas")-1);
- DestroyObject(bobj[playerid]);
- CreateExplosion(cds[0],cds[1],cds[2],7,100.0);
- plantando[playerid] = false;
- SendClientMessage(playerid,-1,bindicador);
- SetPVarInt(playerid,"bombas",--qtdb[playerid]);
- salvardados(playerid);
- }
- else
- {
- SendClientMessage(playerid,-1,"Algo impediu que a bomba explodisse.");
- SendClientMessage(playerid,-1,"Como sua bomba não explodiu, você pega ela de volta.");
- DestroyObject(bobj[playerid]);
- }
- return 1;
- }
- CMD:plantarbomba(playerid,params[])
- {
- if(GetPVarInt(playerid,"bombas") >= 1)
- {
- if(plantando[playerid] == false)
- {
- new strp[75];
- GetPlayerPos(playerid,cds[0],cds[1],cds[2]);
- format(strp,sizeof strp,"Você tem %d bombas, caso aborte a explosão, você não perderá a bomba.",GetPVarInt(playerid,"bombas")-1);
- SendClientMessage(playerid,-1,strp);
- bobj[playerid] = CreateObject(1252,cds[0],cds[1],cds[2],-1,0.0,1.0);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- SendClientMessage(playerid,-1,"use /detonar para explodir a bomba!!!");
- plantando[playerid] = true;
- return 1;
- }
- }
- else return SendClientMessage(playerid,-1,"Você não plantou uma bomba para poder explodir!!");
- return 1;
- }
- CMD:desarmar(playerid,params[])
- {
- if(plantando[playerid] == true)
- {
- if(IsPlayerInRangeOfPoint(playerid,5.0,cds[0],cds[1],cds[2]))
- {
- format(bindicador,sizeof bindicador,"Você desativou sua bomba,e a pegou de volta(%d bombas)",GetPVarInt(playerid,"bombas"));
- SendClientMessage(playerid,-1,bindicador);
- DestroyObject(bobj[playerid]);
- plantando[playerid] = false;
- }
- else return SendClientMessage(playerid,-1,"Você não está perto de sua bomba para desarma-la.");
- }
- else return SendClientMessage(playerid,-1,"Você não plantou uma bomba.");
- return 1;
- }
- CMD:comandosfs(playerid,params[]) return ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX,"Menu","use:\n\n\t/plantarbomba\n\t/desarmar\n\t/bombamenu","Ok","");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement