GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Thiibo0w67 le 29 Mai 2010, 19:11:07
-
salut, alors voila, depuis quelques temps, je ne reçois plus la paye, et d'ailleur personne d'autre, sur un serveur RP, et je ne vois pas d'ou viens le probleme.. QUelqun pourrait m'envoyé la partie de son script de son systeme de paye svp, merci :)
Cordialement
Thiib'z
++
-
C'est plutôt l'inverse... C'est toi qui nous envoie un morceau de ton code pour qu'on voit d'où vient ton problème...
-
Avec toutes les infos que tu nous a aider on va allez loin :)
PS : Si c'est a nous de donner notre boup de script autant qu'on te donne le gm ? Car tu viendra posté des pbs toutes les heures si tu apprend pas..'
-
Pas la peine de tout de suite s'énerver ... Voila le bout de script:
public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[pLevel] > 0)
{
if(MoneyMessage==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "Vous n'avez pas payer votre dette, vous avez gagnez le droit d'aller en prison.");
GameTextForPlayer(i, "~r~Arreter!", 2000, 1);
SetPlayerInterior(i, 6);
PlayerInfo[pInt] = 6;
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
PlayerInfo[pJailed] = 1;
SafeResetPlayerWeapons(i);
SafeResetPlayerMoney(i);
WantedPoints = 0;
PlayerInfo[pJailTime] = 240;
format(string, sizeof(string), "Vous avez été emprisonner pour %d secondes. Caution: Imposible", PlayerInfo[pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[pAccount];
new key = PlayerInfo[pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoney(i))
{
PlayerInfo[pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Vous avez été ejecter.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//maisonInfo[key][hLevel]
}
else
{
if(PlayerInfo[pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[pPayDay] >= 5)
{
Tax += TaxValue;//Should work for every player online
PlayerInfo[pAccount] -= TaxValue;
new checks = PlayerInfo[pPayCheck] / 5;
if(PlayerInfo[pDonateRank] > 0)
{
new bonus = PlayerInfo[pPayCheck] / 10;
checks += bonus;
}
new ebill = (PlayerInfo[pAccount]/10000)*(PlayerInfo[pLevel]);
//ConsumingMoney = 1;
//SafeGivePlayerMoney(i, checks);
account += checks;
if(PlayerInfo[pAccount] > 0)
{
PlayerInfo[pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[pAccount]/1000)*(tmpintrate);
PlayerInfo[pExp]++;
PlayerPlayMusic(i);
PlayerInfo[pAccount] = account+interest;
SendClientMessage(i, COLOR_GREEN, "|___ Salaire ___|");
format(string, sizeof(string), " Salaire HTC : $%d Taxe: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPbiskey] != 255)
{
format(string, sizeof(string), "Facture d'électricitée: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Montant sur votre compte: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Taux d'interets: 0.%d pourcent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Interets perçu $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), " Nouvelle Balance: $%d", PlayerInfo[pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), " Location: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~Salaire ~n~~w~Votre cheque a ete vire a la banque");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[pPayDay] = 0;
ArgentGouv += interest;
SaveStat();
PlayerInfo[pPayCheck] = 0;
PlayerInfo[pConnectTime] += 1;
if(FarmerVar == 0)
{
FarmerPickup[0] = 0;
}
if(DrugFarmerVar == 0)
{
DrugFarmerPickup[0] = 0;
}
if(SmugglerWork == 0)
{
PayDaySecure = 0;
}
if(PlayerInfo[pDonateRank] > 0)
{
PlayerInfo[pPayDayHad] += 1;
if(PlayerInfo[pPayDayHad] >= 5)
{
PlayerInfo[pExp]++;
PlayerInfo[pPayDayHad] = 0;
}
}
}
else
{
SendClientMessage(i, COLOR_WHITE, "* Vous n'avez pas travaillez assez longtemps pour obtenir la paye.");
}
}
}
}
SaveAccounts();
Checkprop();
return 1;
}
-
Commence par regarder si la fonction s'éxécute, met un printf("DEBUG: PayDay()"); au début de la fonction, puis cherche dans tes logs si elle s'est lancée.
Si elle ne s'est pas lancée je vois pas d'autres choses qu'un problème de timer.
-
Merci, je vais éssayé, et si c'est un probleme de timer, je fais comment ?