17.12.2013, 02:40
(
Последний раз редактировалось Jejox; 17.12.2013 в 13:58.
)
Estuve adaptando el sistema de prestamos de OTACON xd, pero tengo un problema, no puedo restarle el dinero que pidio en el prestamo en el PD (Pago Diario) Miren, esto hize.
Errores:
Ya se, tengo que leerme algunos tutoriales sobre array xD si alguien tiene alguno bueno me lo pasa si? :B
pawn Код:
timer severTimers2[1000](){
foreach(Player, i){
if(IsPlayerConnected(i) && gPlayerLogged{i} == 1){
if(Info[i][pTimePayDay] >= 0)
{
new string[128];
Info[i][pTimePayDay]++;
if(Info[i][pTimePayDay] >= 3600){
new tmpintrate, interest, paytotal;
tmpintrate = 1;
interest = (Info[i][pAccount]/1000)*(tmpintrate);
paytotal = Info[i][pPayCheck]-TaxValue;
paytotal = Info[i][pPayCheck]-DineroPrestamo;
if(Info[i][pVIP] == 0 && interest > 1000) interest = 1000;
else if(Info[i][pVIP] == 1 && interest > 2000) interest = 2000;
else if(Info[i][pVIP] == 2 && interest > 3000) interest = 3000;
else if(Info[i][pVIP] == 3 && interest > 5000) interest = 5000;
else if(Info[i][pVIP] >= 4 && interest > 5000) interest = 5000;
Info[i][pAccount] += interest;
if(Info[i][p_Pr_Time] == 10){
SendClientMessageEx(i, COLOR_WHITE, " Ya puedes volver hacer viajes de camionero.");
Info[i][p_Pr_Time] = 0;
}
if(Info[i][pRenting] != INVALID_HOUSE_ID){
if(HouseInfo[Info[i][pRenting]][hRentFee] > Info[i][pAccount]){
Info[i][pRenting] = INVALID_HOUSE_ID;
SendClientMessageEx(i, COLOR_WHITE, "Fuiste desalojado de la casa que rentabas.");
}
else{
HouseInfo[Info[i][pRenting]][hSafeMoney] += HouseInfo[Info[i][pRenting]][hRentFee];
Info[i][pAccount] -= HouseInfo[Info[i][pRenting]][hRentFee];
}
}
Info[i][pRob] = 0;
if(Info[i][pVIP] >= 4) Info[i][pVTokens]+= 2;
if(Info[i][pDobleExp] == 0){Info[i][pExp] += 1;}
else{
Info[i][pExp] += 2;
Info[i][pDobleExp]--;
}
SendClientMessageEx(i, COLOR_WHITE, "|____________RESUMEN DE TU CUENTA____________| ");
format(string, sizeof(string), " " );
SendClientMessageEx(i, COLOR_GRAD2, string);
format(string, sizeof(string), " {FFFFFF}Pago diario: {00FF00}$%d {FFFFFF} | Gastos: {FF0000}-$%d {FFFFFF} | Total: {00FF00}$%d {FFFFFF} ", Info[i][pPayCheck], TaxValue, paytotal);
SendClientMessageEx(i, COLOR_GRAD2, string);
Info[i][pCash] += paytotal;
format(string, sizeof(string), " {FFFFFF}Saldo bancario: {00FF00}%d$ | {FFFFFF}Intereses (Ganancia): {00FF00}$%d |", Info[i][pAccount], interest);
format(string, sizeof(string), " {FFFFFF}Prestamista: {FF0000}-%d {FFFFFF}| Pago por faccion: {00FF00}$", DineroPrestamo);
SendClientMessageEx(i, COLOR_GRAD2, string);
SendClientMessageEx(i, COLOR_WHITE, "|________________FIN DE RESUMEN________________|");
GivePlayerCash(i, paytotal);
Info[i][pPayCheck] = 500;
Info[i][pTimePayDay] = 0;
Info[i][pConnectTime] += 1;
RewardPlayer(i);
OnPlayerSavedStats(i);
GameTextForPlayer(i, "~y~Pago~n~~w~Diario", 5000, 1);
if(Info[i][pConnectTime] == 2){
Info[i][pWRestricted] = 0;
}
if(Info[i][pAdiccion] > 0) Info[i][pAdiccion] -= 2;
if(Info[i][pWRestricted] > 0){
Info[i][pWRestricted]--;
}
if(Info[i][pMember] == 6)
{
GivePlayerMoney(i,17000);
SendClientMessageEx(i, COLOR_GRAD2, "Paga por servicios al Estado: $17.000");
}
}
}
pawn Код:
(51861) : error 033: array must be indexed (variable "DineroPrestamo")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.