Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined MoneyDropFilterscript
- Just the filterscript have a command /dropmoney and drop money that's all :yaoming:
- Money Drop Filterscript by xGanyx
- Pawn compiler 3.2.3664 Copyright (c) 2013, ITB CompuPhase
- #endif
- //includes
- #include <a_samp>
- #include <zcmd>
- //dialog
- #define DIALOG_MAIN 1554
- #define DIALOG_CASH 1555
- #define DIALOG_ICON 1556
- #define DIALOG_BAG 1557
- //Colors
- #define Red 0xFF0000FF
- #define Green 0x00FF40FF
- #define Yellow 0xFFFF00FF
- //defines
- #define cmoneycp 1
- #define imoneycp 2
- #define bmoneycp 3
- //pragma
- #pragma tabsize 0
- //to make the money
- new cmoney;
- new imoney;
- new bmoney;
- //Pickups
- new cmoneypick;
- new imoneypick;
- new bmoneypick;
- //Others
- new fmoney[MAX_PLAYERS];
- new pname[MAX_PLAYERS][MAX_PLAYER_NAME];
- //Float
- new Float:cmoneyx,Float:cmoneyy,Float:cmoneyz;
- new Float:imoneyx,Float:imoneyy,Float:imoneyz;
- new Float:bmoneyx,Float:bmoneyy,Float:bmoneyz;
- enum cPickinfo
- {
- Float:cPickX,
- Float:cPickY,
- Float:cPickZ,
- chavefmoney
- }
- new cPickupInfo[MAX_PICKUPS][cPickinfo];
- enum iPickinfo
- {
- Float:iPickX,
- Float:iPickY,
- Float:iPickZ,
- ihavefmoney
- }
- new iPickupInfo[MAX_PICKUPS][iPickinfo];
- enum bPickinfo
- {
- Float:bPickX,
- Float:bPickY,
- Float:bPickZ,
- bhavefmoney
- }
- new bPickupInfo[MAX_PICKUPS][bPickinfo];
- public OnFilterScriptInit()
- {
- print(" Money Drop FilterScript Loaded");
- return 1;
- }
- public OnPlayerPickUpPickup(playerid,pickupid)
- {
- if(pickupid == cmoneypick)
- {
- if(cPickupInfo[cmoneypick][chavefmoney] == 1)
- {
- new string[128];
- GivePlayerMoney(playerid,cmoney);
- DestroyPickup(cmoneypick);
- format(string,sizeof(string),"%s has pickup the drop money",pname[playerid]);
- SendClientMessageToAll(Yellow,string);
- cPickupInfo[cmoneypick][chavefmoney] = 0;
- }
- }
- if(pickupid == imoneypick)
- {
- if(iPickupInfo[imoneypick][ihavefmoney] == 1)
- {
- new string[128];
- GivePlayerMoney(playerid,imoney);
- DestroyPickup(imoneypick);
- format(string,sizeof(string),"%s has pickup the drop money",pname[playerid]);
- SendClientMessageToAll(Yellow,string);
- iPickupInfo[imoneypick][ihavefmoney] = 0;
- }
- }
- if(pickupid == bmoneypick)
- {
- if(bPickupInfo[bmoneypick][bhavefmoney] == 1)
- {
- new string[128];
- GivePlayerMoney(playerid,bmoney);
- DestroyPickup(bmoneypick);
- format(string,sizeof(string),"%s has pickup the drop money",pname[playerid]);
- SendClientMessageToAll(Yellow,string);
- bPickupInfo[bmoneypick][bhavefmoney] = 0;
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(fmoney[playerid] == cmoneycp)
- {
- DisablePlayerCheckpoint(playerid);
- }
- if(fmoney[playerid] == imoneycp)
- {
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- COMMAND:dropmoney(playerid,params[])
- {
- ShowPlayerDialog(playerid,DIALOG_MAIN,DIALOG_STYLE_LIST,"Please Choose Pay","Cash = 1 - 1000$\nicon = 1001 - 4000$\n Money Bag = 4000$ >>>","Choose","Cancel");
- return 1;
- }
- COMMAND:testdropmoney(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"You not authorized to use this command");
- GivePlayerMoney(playerid,10000);
- return 1;
- }
- COMMAND:findmoney(playerid,params[])
- {
- if(cPickupInfo[cmoneypick][chavefmoney] == 1)
- {
- fmoney[playerid] = cmoneycp;
- SetPlayerCheckpoint(playerid,cmoneyx,cmoneyy,cmoneyz,3.0);
- }
- if(iPickupInfo[imoneypick][ihavefmoney] == 1)
- {
- fmoney[playerid] = imoneycp;
- SetPlayerCheckpoint(playerid,imoneyx,cmoneyy,cmoneyz,3.0);
- }
- if(bPickupInfo[bmoneypick][bhavefmoney] == 1)
- {
- fmoney[playerid] = bmoneycp;
- SetPlayerCheckpoint(playerid,bmoneyx,bmoneyy,bmoneyz,3.0);
- }
- else return SendClientMessage(playerid,Red,"Don't have any drop money to find");
- return 1;
- }
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_MAIN:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) >= 1)
- {
- ShowPlayerDialog(playerid,DIALOG_CASH,DIALOG_STYLE_INPUT,"Money Drop","Put the money you want to drop here","Done","Cancel");
- }
- else return SendClientMessage(playerid,Red,"You don't have enough money to use this");
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) >= 1001)
- {
- ShowPlayerDialog(playerid,DIALOG_ICON,DIALOG_STYLE_INPUT,"Money Drop","Put the money you want to drop here","Done","Cancel");
- }
- else return SendClientMessage(playerid,Red,"You don't have enough money to use this");
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) >= 4000)
- {
- ShowPlayerDialog(playerid,DIALOG_BAG,DIALOG_STYLE_INPUT,"Money Drop","Put the money you want to drop here","Done","Cancel");
- }
- else return SendClientMessage(playerid,Red,"You don't have enough money to use this");
- }
- }
- }
- }
- case DIALOG_CASH:
- {
- if(response)
- {
- if(response)
- {
- if(strval(inputtext) < 1000)
- {
- new string[128];
- cmoney = strval(inputtext);
- cPickupInfo[cmoneypick][chavefmoney] = 1;
- cPickupInfo[cmoneypick][cPickX] = cmoneyx;
- cPickupInfo[cmoneypick][cPickY] = cmoneyy;
- cPickupInfo[cmoneypick][cPickZ] = cmoneyz;
- if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,Red,"You don't have enough money");
- if(strval(inputtext) > 1000) return SendClientMessage(playerid,Red,"Money cannot higher than 1000$ if you want more use icon");
- GetPlayerName(playerid,pname[playerid],MAX_PLAYER_NAME);
- GivePlayerMoney(playerid,-strval(inputtext));
- GetPlayerPos(playerid,cmoneyx,cmoneyy,cmoneyz);
- cmoneypick = CreatePickup(1212,1,cmoneyx,cmoneyy+2,cmoneyz,0);
- format(string,sizeof(string),"%s has drop he or she money. /findmoney to find it.",pname[playerid]);
- SendClientMessageToAll(Green,string);
- }
- }
- }
- }
- case DIALOG_ICON:
- {
- if(response)
- {
- if(strval(inputtext) < 4000 || strval(inputtext) > 1000)
- {
- new string[128];
- imoney = strval(inputtext);
- iPickupInfo[imoneypick][ihavefmoney] = 1;
- iPickupInfo[imoneypick][iPickX] = imoneyx;
- iPickupInfo[imoneypick][iPickY] = imoneyy;
- iPickupInfo[imoneypick][iPickZ] = imoneyz;
- if(strval(inputtext) > 4000) return SendClientMessage(playerid,Red,"Money cannot higher than 1000$ if you want more use Bag Money");
- if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,Red,"You don't have enough money");
- GetPlayerName(playerid,pname[playerid],MAX_PLAYER_NAME);
- GetPlayerPos(playerid,imoneyx,imoneyy,imoneyz);
- imoneypick = CreatePickup(1274,1,imoneyx,imoneyy,imoneyz,0);
- format(string,sizeof(string),"%s has drop he or she money. /findmoney to find it.",pname[playerid]);
- SendClientMessageToAll(Green,string);
- }
- }
- }
- case DIALOG_BAG:
- {
- if(response)
- {
- if(strval(inputtext) > 4000)
- {
- new string[128];
- bmoney = strval(inputtext);
- bPickupInfo[bmoneypick][bhavefmoney] = 1;
- bPickupInfo[bmoneypick][bPickX] = bmoneyx;
- bPickupInfo[bmoneypick][bPickY] = bmoneyy;
- bPickupInfo[bmoneypick][bPickZ] = bmoneyz;
- if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,Red,"You don't have enough money");
- GetPlayerName(playerid,pname[playerid],MAX_PLAYER_NAME);
- GetPlayerPos(playerid,bmoneyx,bmoneyy,bmoneyz);
- bmoneypick = CreatePickup(1276,1,bmoneyx,bmoneyy,bmoneyz,0);
- format(string,sizeof(string),"%s has drop he or she money. /findmoney to find it.",pname[playerid]);
- SendClientMessageToAll(Green,string);
- }
- }
- }
- }
- return 1;
- }
- stock IsNumeric( string[ ] ) { for (new i = 0, j = strlen( string); i < j; i++) if ( string[i] > '9' || string[i] < '0') return 0; return 1; }
Add Comment
Please, Sign In to add comment