pawn Код:
#include <a_samp>
#include <zcmd>
#include <a_CashRegister>
public OnFilterScriptInit() {
print("\n**************************************");
print(" Cash Register System in SA-MP ");
print(" Date: 23/07/2013 ");
print(" Author: OTACON ");
print(" --* Loaded with Success!!. *-- ");
print("***************************************\n");
CreateCashRegister(0, -2674.64355, 267.79822, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(1, -2677.96436, 267.79922, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(2, -2681.52490, 267.79755, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(3, -2671.36157, 267.61661, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(4, -2684.68579, 267.89069, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(5, -2688.02539, 268.00455, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(6, -2691.34619, 267.99829, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(7, -2694.72437, 268.12247, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(8, -2668.12427, 267.47256, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(9, -2664.72852, 267.28238, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(10, -2661.40698, 267.19272, 3.32653, 0.00000, 0.00000, 0.00000);
CreateCashRegister(11, -2658.32715, 267.10367, 3.32653, 0.00000, 0.00000, 0.00000);
return true;
}
public OnFilterScriptExit() {
print("\n**************************************");
print(" Cash Register System in SA-MP ");
print(" Date: 23/07/2013 ");
print(" Author: OTACON ");
print(" --* Downloaded with Success!!. *-- ");
print("***************************************\n");
DestroyCashRegister(0);
DestroyCashRegister(1);
DestroyCashRegister(2);
DestroyCashRegister(3);
DestroyCashRegister(4);
DestroyCashRegister(5);
DestroyCashRegister(6);
DestroyCashRegister(7);
DestroyCashRegister(8);
DestroyCashRegister(9);
DestroyCashRegister(10);
return true;
}
COMMAND:test1(playerid, params[]) {
if(!IsPlayerInRangeOfCashRegister(playerid, 2.0)) return SendClientMessage(playerid,-1,"vocк nгo estб perto de uma caixa registradora.");
if(GetPlayerMoney(playerid)<=0) return SendClientMessage(playerid,-1,"vocк nгo tem dinheiro.");
PutMoneyInCashRegister(playerid, 5000);
SendClientMessage(playerid,-1,"Vocк coloca 5.000 dуlares no registo");
return true;
}
COMMAND:test2(playerid, params[]) {
if(!IsPlayerInRangeOfCashRegister(playerid, 2.0)) return SendClientMessage(playerid,-1,"vocк nгo estб perto de uma caixa registradora.");
if(GetMoneyInCashRegister(playerid)<=0) return SendClientMessage(playerid,-1,"Esta caixa registradora nгo tem mais dinheiro.");
GiveMoneyFromCashRegister(playerid, 100);
SendClientMessage(playerid,-1,"Vocк levou R $ 100 do caixa registadora.");
return true;
}
COMMAND:test3(playerid, params[]) {
new _info[100];
format(_info,sizeof(_info),"Existem %d xajas regista criado.",CountCashRegister());
SendClientMessage(playerid,-1,_info);
return true;
}
COMMAND:test4(playerid, params[]) {
DestroyCashRegisterAll();
SendClientMessage(playerid,-1,"Vocк destruiu todos os registros criados.");
return true;
}