Hi,
ich habe das so eingestellt das jeder spieler pro gespielter stunde einen payday bekommt. doch dieser kommt nie! warum?! was fehlt? Welche angeben muss ich hier posten damit man den fehler entnehmen kann?
gruß
Hi,
ich habe das so eingestellt das jeder spieler pro gespielter stunde einen payday bekommt. doch dieser kommt nie! warum?! was fehlt? Welche angeben muss ich hier posten damit man den fehler entnehmen kann?
gruß
wie wäre es mit allem was zum payday gehört. Damit können wir dir viel helfen
Ok =)
forward PayDay(i);
pPayDay,
pPayDayHad,
pPaydayZeit,
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayDayHad] = 0;
public PayDay(i)
{
new string[128];
new account,interest;
new rent = 0;
if(IsPlayerConnected(i))
{
SetPlayerGehalt(i);
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
new key = PlayerInfo[i][pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > PlayerMoney[i])
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Du konntest deine Miete nicht bezahlen, und wurdest rausgeschmissen");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
if(PlayerInfo[i][pDonateRank] > 0)
{
}
new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
// Geld abziehen ^.^
// PlayerInfo[i][pAccount] += Gehalt[i];
// PlayerInfo[i][pAccount] -= Tax;
account += Gehalt[i];
account -= Tax;
// Geld abziehen ^.^
if(PlayerInfo[i][pAccount] > 0)
{
PlayerInfo[i][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, COLOR_GREEN, "|___ PAYDAY/ZAHLTAG ___|");
format(string, sizeof(string), " Gehalt: $%d Steuern: -$%d", Gehalt[i], Tax);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Stromkosten: -$%d", ebill);
SendClientMessage(i, COLOR_WHITE, string);
}
format(string, sizeof(string), " Kontostand: $%d", account);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinssrate: 0.%d Prozent",tmpintrate);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinsen erhalten: $%d", interest);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Miete: -$%d", rent);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Respektpunkte erhalten: 1");
SendClientMessage(i, COLOR_WHITE, string);
SendClientMessage(i, COLOR_WHITE, "|--------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "~y~Zahltag");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pLoginZeit] = 1;
PlayerInfo[i][pConnectTime] -= 3600;
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
// Checkprop();
return 1;
}
if(PlayerInfo[i][pPaydayZeit] == 60)
{
PayDay(i);
PlayerInfo[i][pPaydayZeit] = 0;
}
public SyncTime()
{
new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "Deine Uhr: Es ist %d:00 Uhr",tmphour+1);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
PayDay();
if (realtime)
{
SetWorldTime(tmphour+1);
}
//SendClientMessageToAll(COLOR_ORANGE,"Anstehende Geburtstage:");
//SendClientMessageToAll(COLOR_ORANGE," 25.6.09: [FoD]GomeZ");
}
}
format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
format(var, 32, "PayDayHad=%d\n",PlayerInfo[playerid][pPayDayHad]);fwrite(hFile, var);
format(var, 64, "PaydayZeit=%d\n",PlayerInfo[playerid][pPaydayZeit]);fwrite(hFile, var);
if( strcmp( key , "PayDay" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDay] = strval( val ); }
if( strcmp( key , "PayDayHad" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDayHad] = strval( val ); }
if( strcmp( key , "PayDay" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDay] = strval( val ); }
if(strcmp(cmd, "/payday", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
PlayerInfo[playerid][pPaydayZeit] += 60;
PayDay(playerid);
}
return 1;
}
if(strcmp(cmd, "/paydayfor",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 5)
{
ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_MSGBOX,"Access denied!","Du bist kein Admin und hast somit kein Zugriff auf diesen Befehl !","OK","Abbrechen");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /paydayfor [Playerid/TeilDesNamen]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du hast %s zum PayDay verholfen", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Du wurdest von %s zum PayDay verdonnert.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pPaydayZeit] = 60;
PayDay(playerid);
format(string, sizeof(string), "AdmWarning: %s hat %s einen PayDay gegeben", sendername, giveplayer);
ABroadCast(COLOR_RED, string, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist Offline !");
return 1;
}
}
return 1;
}
public IncreasePlayerMinutes()
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
PlayerInfo[i][pPlayMinutes]++;
PlayerInfo[i][pGesamtMinutes]++;
PlayerInfo[i][pMinutesSinceLogin]++;
PlayerInfo[i][pMinutesSinceAn]++;
if(PlayerInfo[i][pPlayMinutes] >= 60)
{
//PayDay(i);
PlayerInfo[i][pPlayMinutes] = 0;
}
if(KnastTime[i] > 0)
{
KnastTime[i]--;
}
if(KnastTime[i] == 0 && Knast[i] > 0)
{
Knast[i] = 0;
KnastTime[i] = 0;
SpawnPlayer(i);
SendClientMessage(i,COLOR_YELLOW," Benimm dich ab jetzt, oder ein Admin wird dich wieder einsperren!");
}
}
}
return 1;
}
hab jetzt alles kopiert was mit payday zutun hat.. xD
Probier es mla so:
public IncreasePlayerMinutes()
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
PlayerInfo[i][pPlayMinutes]++;
PlayerInfo[i][pGesamtMinutes]++;
PlayerInfo[i][pMinutesSinceLogin]++;
PlayerInfo[i][pMinutesSinceAn]++;
if(PlayerInfo[i][pPlayMinutes] >= 60)
{
PayDay(i);
PlayerInfo[i][pPlayMinutes] = 0;
}
if(KnastTime[i] > 0)
{
KnastTime[i]--;
}
if(KnastTime[i] == 0 && Knast[i] > 0)
{
Knast[i] = 0;
KnastTime[i] = 0;
SpawnPlayer(i);
SendClientMessage(i,COLOR_YELLOW," Benimm dich ab jetzt, oder ein Admin wird dich wieder einsperren!");
}
}
}
return 1;
}
public PayDay(i)
{
new string[128];
new account,interest;
new rent = 0;
if(IsPlayerConnected(i) && PlayerInfo[i][pPlayMinutes] >= 60)
{
PlayerInfo[i][pPlayMinutes] = 0;
SetPlayerGehalt(i);
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
new key = PlayerInfo[i][pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > PlayerMoney[i])
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Du konntest deine Miete nicht bezahlen, und wurdest rausgeschmissen");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
if(PlayerInfo[i][pDonateRank] > 0)
{
}
new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
// Geld abziehen ^.^
// PlayerInfo[i][pAccount] += Gehalt[i];
// PlayerInfo[i][pAccount] -= Tax;
account += Gehalt[i];
account -= Tax;
// Geld abziehen ^.^
if(PlayerInfo[i][pAccount] > 0)
{
PlayerInfo[i][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, COLOR_GREEN, "|___ PAYDAY/ZAHLTAG ___|");
format(string, sizeof(string), " Gehalt: $%d Steuern: -$%d", Gehalt[i], Tax);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Stromkosten: -$%d", ebill);
SendClientMessage(i, COLOR_WHITE, string);
}
format(string, sizeof(string), " Kontostand: $%d", account);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinssrate: 0.%d Prozent",tmpintrate);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinsen erhalten: $%d", interest);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Miete: -$%d", rent);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Respektpunkte erhalten: 1");
SendClientMessage(i, COLOR_WHITE, string);
SendClientMessage(i, COLOR_WHITE, "|--------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "~y~Zahltag");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pLoginZeit] = 1;
PlayerInfo[i][pConnectTime] -= 3600;
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
// Checkprop();
return 1;
}
public SyncTime()
{
new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "Deine Uhr: Es ist %d:00 Uhr",tmphour+1);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
//PayDay();
if (realtime)
{
SetWorldTime(tmphour+1);
}
//SendClientMessageToAll(COLOR_ORANGE,"Anstehende Geburtstage:");
//SendClientMessageToAll(COLOR_ORANGE," 25.6.09: [FoD]GomeZ");
}
}