19.06.2010, 16:45
pawn Код:
//********************************
//** FS - COMPRA DE ARMAS **
//** FS - POR DIALOG **
//** CRIADO POR: SuB_ZeRo0_ **
//** Apenas uso para: **
//** Editar e aprender **
//********************************
#include <a_samp>
#include <armasSZ>
new ADS;
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
SetTimer("PADS",TempoADS,true);
return 1;
}
forward PADS();
public PADS() {
if(ADS==0) {ADS=1;SendClientMessageToAll(laranja,MSGAD1);return 1;}
if(ADS==1) {ADS=2;SendClientMessageToAll(laranja,MSGAD2);return 1;}
if(ADS==2) {ADS=0;SendClientMessageToAll(laranja,MSGAD3);return 1;}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(Comando, cmdtext, true, 10) == 0)
{
if(GetPlayerInterior(playerid) == 1 || GetPlayerInterior(playerid) == 4 || GetPlayerInterior(playerid) == 6 || GetPlayerInterior(playerid) == 7)
{
new strcp[256];
new ValorSawn=VSAWN;new ValorTec=VTEC;new ValorPistol=VPISTOL;new ValorDesert=VDESERT;new ValorCombat=VCOMBAT;new ValorMsmg=VMicroSMG;new ValorSmg=VSMG;new ValorAk=VAK;new ValorColt=VCOLT;new ValorSniper=VSNIPER;new ValorExt=VEXTIN;
format(strcp,sizeof(strcp),TextoMenu,ValorPistol,ValorDesert,ValorSawn,ValorTec,ValorCombat,ValorMsmg,ValorSmg,ValorAk,ValorColt,ValorSniper,ValorExt);
ShowPlayerDialog(playerid,IDMENU,DIALOG_STYLE_LIST,NomeMenu,strcp,Btn1,Btn2);
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==IDMENU) {
if(response) {
if(listitem==0) {
if(GetPlayerMoney(playerid)<VPISTOL) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,PISTOL,DIALOG_STYLE_INPUT,TextoC1,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==1) {
if(GetPlayerMoney(playerid)<VDESERT) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,DESERT,DIALOG_STYLE_INPUT,TextoC2,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==2) {
if(GetPlayerMoney(playerid)<VSAWN) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,SAWN,DIALOG_STYLE_INPUT,TextoC3,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==3) {
if(GetPlayerMoney(playerid)<VTEC) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,SAWN,DIALOG_STYLE_INPUT,TextoC4,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==4) {
if(GetPlayerMoney(playerid)<VCOMBAT) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,COMBAT,DIALOG_STYLE_INPUT,TextoC5,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==5) {
if(GetPlayerMoney(playerid)<VMicroSMG) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,MicroSMG,DIALOG_STYLE_INPUT,TextoC6,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==6) {
if(GetPlayerMoney(playerid)<VSMG) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,SMG,DIALOG_STYLE_INPUT,TextoC7,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==7) {
if(GetPlayerMoney(playerid)<VAK) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,AK,DIALOG_STYLE_INPUT,TextoC8,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==8) {
if(GetPlayerMoney(playerid)<VCOLT) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,COLT,DIALOG_STYLE_INPUT,TextoC9,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==9) {
if(GetPlayerMoney(playerid)<VSNIPER) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,SNIPER,DIALOG_STYLE_INPUT,TextoC10,MSGComprar,Btn1,Btn2);}
return 1;}
if(listitem==10) {
if(GetPlayerMoney(playerid)<VEXTIN) return SendClientMessage(playerid,vermelho,SDinheiro);
else {ShowPlayerDialog(playerid,EXTIN,DIALOG_STYLE_INPUT,TextoC11,MSGComprar,Btn1,Btn2);}
return 1;}}
return 1;
}
if(dialogid==SAWN) {
if(response) {
new BalasP=strval(inputtext)*PSAWN+VSAWN;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma1,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==TEC) {
if(response) {
new BalasP=strval(inputtext)*PTEC+VTEC;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma2,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==PISTOL) {
if(response) {
new BalasP=strval(inputtext)*PPISTOL+VPISTOL;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma3,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==DESERT) {
if(response) {
new BalasP=strval(inputtext)*PDESERT+VDESERT;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma4,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==COMBAT) {
if(response) {
new BalasP=strval(inputtext)*PCOMBAT+VCOMBAT;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma5,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==MicroSMG) {
if(response) {
new BalasP=strval(inputtext)*PMicroSMG+VMicroSMG;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma6,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==SMG) {
if(response) {
new BalasP=strval(inputtext)*PSMG+VSMG;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma7,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==AK) {
if(response) {
new BalasP=strval(inputtext)*PAK+VAK;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma8,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==COLT) {
if(response) {
new BalasP=strval(inputtext)*PCOLT+VCOLT;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma9,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==SNIPER) {
if(response) {
new BalasP=strval(inputtext)*PSNIPER+VSNIPER;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma10,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
if(dialogid==EXTIN) {
if(response) {
new BalasP=strval(inputtext)*PEXTIN+VEXTIN;
if(GetPlayerMoney(playerid)<BalasP) return SendClientMessage(playerid,vermelho,SBDinheiro);
else {GivePlayerMoney(playerid,-(BalasP));GivePlayerWeapon(playerid,ID_Arma11,strval(inputtext));SendClientMessage(playerid,amarelo,MSGSucesso);}}
return 1;
}
return 1;
}
//********************************
//** FS - COMPRA DE ARMAS **
//** FS - POR DIALOG **
//** CRIADO POR: SuB_ZeRo0_ **
//** Apenas uso para: **
//** Editar e aprender **
//********************************