public PayDay()
{
new string[128];
new account;
new interest,rent = 0, key;
PayDayLeft = 60;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
HouseInfo[key][hRentabil] = HouseInfo[key][hRentabil]+rent;
}
new tmpintrate;
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
new checks = 500;
account += checks;
interest = (PlayerInfo[i][pAccount]/500)*(tmpintrate);
PlayerInfo[i][pAccount] = account+interest;
new ebill = 20;
if(PlayerInfo[i][pPhousekey] != 999 || PlayerInfo[i][pPbiskey] != 255)
{
PlayerInfo[i][pAccount] -= ebill;
}
else
{
ebill = 0;
}
SendClientMessage(i, COLOR_ASKQ, "|___ Estado Bancario ___|");
format(string, sizeof(string), " Pago: $%d Impuestos: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Boleta de Electricidad: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Gastos totales: $%d", TaxValue + ebill);
SendClientMessage(i, COLOR_GRAD3, string);
format(string, sizeof(string), " Beneficios totales: $%d", checks-ebill-TaxValue);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, 0xB6B6B6FF, "|--------------------------------------|");
format(string, sizeof(string), " Antiguo Balance: %d$", PlayerInfo[i][pAccount] - checks + ebill + TaxValue);
SendClientMessage(i, 0x00711DFF, string);
format(string, sizeof(string), " Nuevo Balance: %d$", PlayerInfo[i][pAccount]);
SendClientMessage(i, 0x00CC00FF, string);
format(string, sizeof(string), "~h~~g~dia de paga");
GameTextForPlayer(i, string, 5000, 1);
cNicotina[i] = 0; cEnergysil[i] = 0; cSIDA[i] = 0; cCancer[i] = 0; cEpilepsia[i] = 0;
PlayerInfo[i][pRob] = 0;
PlayerInfo[i][pConnectTime] += 1;
PlayerInfo[i][pExp]++;
if(PlayerInfo[i][pContract] > 0){PlayerInfo[i][pContract] --;}
}
}
}
SaveAccounts();
return 1;
}
me gustarнa saber como hago para que los autos no exploten, sino que se averieen ... es decir que cuando ya tenga un daсo considerable simplemente se apague y no arranque. |
Tambien me gustaria saber que cuando el PJ tenga por ejemplo solo un 20 % de vida caiga al suelo y no se pueda poner de pie, es decir que comienze a agonizar. |
new Float:health;
GetPlayerHealth(playerid,health);
if(health <= 20)
{
TogglePlayerControllable(playerid, 0);
//la animaciуn que quieras ApplyAnimation
}
Como hago para que deacuerdo al dinero en el banco que tenga guardado, en el payday se le sume x cantidad de dinero por los intereses. |
Muchas gracias por responder. Pero ahora me surgio alg omas... como hago para que cuando este herido agonizando no pueda ponerse de pie ni usar el telйfono, es decir que no use ninguna animaciуn?
|
new Injured[MAX_PLAYERS];
Usa una variable por ejemplo:
pawn Код:
|
new Injured[MAX_PLAYERS]
if (IsPlayerConnected(playerid))
{
if (GetPlayerHealth (playerid) < 15, Injured, 1 );
else Injured = 0;
}
return
// ZCMD - Si usas procesador de comandos como el zcmd.
new Injured[MAX_PLAYERS]; // Donde estбn tus variables
zcmd(handsup, playerid, params[]) // Comando
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && Injured[playerid] == 0) // Condiciones
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
else return SendClientMessage(playerid, COLOR_GRAD2, " No puedes usar este comando ahora.");
}
// Si no usas procesador de comandos.
new Injured[MAX_PLAYERS]; // Donde estбn tus variables
if(strcmp(cmd, "/rendirse", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && Injured[playerid] == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
}
return 1;
}