• 05 Juillet 2025, 23:40:10


Auteur Sujet: Forcer la paye par une commande  (Lu 1414 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne jordanve

  • *
  • Tueur
  • Messages: 88
    • Voir le profil
    • Arizona City
Forcer la paye par une commande
« le: 09 Mars 2010, 22:35:12 »
Bonjour,

Je voudrais forcer la paye qui vient toutes les heures.

Un pote ma passé ce code ci dessous mais ça marque "Vous n'avez pas jouer ainser longtemp pour obtenir votre paye".

if(strcmp(cmd, "/payday", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Vous devez d'abord vous identifiez !");
            return 1;
        }
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Vous n'êtes pas autorisé à utilisez cette commande !");
return 1;
}
    PayDay();
}
return 1;
}

Merci beaucoup

Hors ligne Mr_C30

  • *
  • Gangster
  • souvent conquise jamais soumise
  • Messages: 1937
    • Voir le profil
Re : Forcer la paye par une commande
« Réponse #1 le: 09 Mars 2010, 22:40:08 »
fait nous voir le payday  :ohmy



Radis du soir bonsoir !


Hors ligne jordanve

  • *
  • Tueur
  • Messages: 88
    • Voir le profil
    • Arizona City
Re : Forcer la paye par une commande
« Réponse #2 le: 09 Mars 2010, 22:42:27 »
Voilà :

public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLevel] > 0)
    {
    if(MoneyMessage[i]==1)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Vous n'avez pas payé vos dette, vous allez en prison.");
    GameTextForPlayer(i, "~r~Bousiller!", 2000, 1);
    SetPlayerInterior(i, 6);
    PlayerInfo[i][pInt] = 6;
    SetPlayerPos(i, 264.6288,77.5742,1001.0391);
            PlayerInfo[i][pJailed] = 1;
            SafeResetPlayerWeapons(i);
            SafeResetPlayerMoney(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "Vous êtes en prisons pour %d secondes.   Caution: Incapable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
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 > GetPlayerMoney(i))
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Vous avez été éjecté.");
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; }
}
if(PlayerInfo[i][pPayDay] >= 6)
{
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck] / 6;
if(PlayerInfo[i][pDonateRank] > 0)
{
    new bonus = PlayerInfo[i][pPayCheck] / 10;
    checks += bonus;
}
    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
    //ConsumingMoney[i] = 1;
    //SafeGivePlayerMoney(i, checks);
    account += checks;
    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, "|________________ Extrait de Compte ________________|");
format(string, sizeof(string), "  Salaire HTC: $%d   Taxe: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
    format(string, sizeof(string), "  Facture d'Electrécité: -$%d", ebill);
SendClientMessage(i, COLOR_WHITE, string);
}
format(string, sizeof(string), "  Argent sur le compte avant  paycheck: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "  Interêt: 0.%d pourcent",tmpintrate);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "  Interêt Gagné $%d", interest);
SendClientMessage(i, COLOR_WHITE, string);
SendClientMessage(i, COLOR_GREEN, "|----------------------------------------------------|");
format(string, sizeof(string), "  Argent sur le compte après  paycheck: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "  Location: -$%d", rent);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pHotel] == 1)
{
                        new hotelcost = BizzInfo[6][bEntranceCost];
    format(string, sizeof(string), "  Hotel: -$%d", hotelcost);
SendClientMessage(i, COLOR_WHITE, string);
BizzInfo[6][bTill] += BizzInfo[6][bEntranceCost];
ExtortionBiz(6, BizzInfo[6][bEntranceCost]);
BizzInfo[6][bProducts]--;
PlayerInfo[i][pAccount] -= hotelcost;
OnPropUpdate();
}
format(string, sizeof(string), "~y~PayDay~n~~w~Allez voir votre compte");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
if(FarmerVar[i] == 0)
{
FarmerPickup[i][0] = 0;
}
if(DrugFarmerVar[i] == 0)
{
DrugFarmerPickup[i][0] = 0;
}
if(SmugglerWork[i] == 0)
{
PayDaySecure[i] = 0;
}
if(PlayerInfo[i][pDonateRank] > 0)
{
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
        PlayerInfo[i][pExp]++;
        PlayerInfo[i][pPayDayHad] = 0;
    }
}
}
else
{
    SendClientMessage(i, COLOR_WHITE, "* Vous n'avez pas jouer assez longtemps pour obtenir votre paye.");
}
}
}
}
SaveAccounts();
Checkprop();
return 1;
}

Hors ligne Mr_C30

  • *
  • Gangster
  • souvent conquise jamais soumise
  • Messages: 1937
    • Voir le profil
Re : Forcer la paye par une commande
« Réponse #3 le: 09 Mars 2010, 22:46:00 »
je n'arive pas trop a lire ;D   mais essaye secis  ;)
Code: (pawno) [Sélectionner]
if(strcmp(cmd, "/payday", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Vous devez d'abord vous identifiez !");
            return 1;
        }
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Vous n'êtes pas autorisé à utilisez cette commande !");
return 1;
}
                            PlayerInfo[playerid][pPayDay] = 7;
    PayDay();
}
return 1;
}




Radis du soir bonsoir !


Hors ligne jordanve

  • *
  • Tueur
  • Messages: 88
    • Voir le profil
    • Arizona City
Re : Forcer la paye par une commande
« Réponse #4 le: 09 Mars 2010, 22:55:18 »
Merci beaucoup ça fonctionne a merveille !

Bonne nuit

Hors ligne MrFredo

  • *
  • Grand Banditisme
  • Scripteur PHP/PAWN
  • Messages: 953
    • Voir le profil
    • GTA-Hosting
Re : Forcer la paye par une commande
« Réponse #5 le: 10 Mars 2010, 16:41:33 »
Sa marche pour toi mais pas pour les autre qui n'ont pas la variables a + de 7  :P

Hors ligne FuSion

  • Pawn coder
  • *
  • Grand Banditisme
  • for(new i = 0; i < INFINI; i++)
  • Messages: 888
    • Voir le profil
Re : Forcer la paye par une commande
« Réponse #6 le: 10 Mars 2010, 16:51:36 »
Un simple GetPlayerMoney puis une condition qui detecte s'il as l'argent qu'il faut puis un GivePlayerMoney en valeur negatif ferais l'affaire dans ce cas-ci alors  :)

Hors ligne dixon

  • *
  • Tueur en série
  • Jamais Je n'abandonnerai
  • Messages: 159
    • Voir le profil
    • :... Universal Gaming ...:
Re : Forcer la paye par une commande
« Réponse #7 le: 10 Mars 2010, 18:59:25 »
Bonjour, Oui Fredo à raison ! Pour cela tu a une solution tu le fait à chaque joueur connecté par son id approprié ! Et un giveplayerid suffit !

Code :

if(strcmp(cmd, "/payday", true) == 0) // By DiXoN
{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "   Vous devez d'abord vous identifiez !");
           return 1;
       }
       tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "USAGE: /payday [playerid/partiDuNom]");
    return 1;
    }
giveplayerid = ReturnUser(tmp);
if (giveplayerid == INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid, COLOR_GREY, "Ce joueur n'est pas là");
    return 1;
    }
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Vous n'êtes pas autorisé à utilisez cette commande !");
return 1;
}
   PlayerInfo[giveplayerid][pPayDay] = 7;
PayDay();
}
return 1;
}
« Modifié: 10 Mars 2010, 19:02:44 par dixon »
Modern Sensation RP, Du RP comme vous en avez jamais VU
En Construction | Ouverture Beta Bientôt

Hors ligne Oscar

  • *
  • Tueur
  • Messages: 68
    • Voir le profil
Re : Forcer la paye par une commande
« Réponse #8 le: 10 Mars 2010, 21:19:14 »
Mais non.. Ce qui veut, à mon avis, c'est forcer la paie à tous les joueurs connectés..

Hors ligne jordanve

  • *
  • Tueur
  • Messages: 88
    • Voir le profil
    • Arizona City
Re : Forcer la paye par une commande
« Réponse #9 le: 11 Mars 2010, 19:26:01 »
Salut

lol en faite je veux les 2 celle la de dixon et pour tous les joueurs. :-[

Merci

Hors ligne Oscar

  • *
  • Tueur
  • Messages: 68
    • Voir le profil
Re : Forcer la paye par une commande
« Réponse #10 le: 13 Mars 2010, 18:51:12 »
Faut trouver autre chose que giveplayerid.. Je suis en train de chercher une commande qui permet de faire une certaine chose à tous les joueurs..

genre un allplayerid ou autre..

Hors ligne dixon

  • *
  • Tueur en série
  • Jamais Je n'abandonnerai
  • Messages: 159
    • Voir le profil
    • :... Universal Gaming ...:
Re : Forcer la paye par une commande
« Réponse #11 le: 13 Mars 2010, 19:09:26 »
Re, Voilà je ne l'ai pas re testé mais sa devrai être bon :

if(strcmp(cmd, "/payday", true) == 0) // By DiXoN
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Vous devez d'abord vous identifiez !");
            return 1;
        }
    for(new i=0; i<MAX_PLAYERS; i++)
    {
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Vous n'êtes pas autorisé à utilisez cette commande !");
return 1;
}
PlayerInfo[playerid][pPayDay] = 5;
    PayDay();
}
}
return 1;
}
Modern Sensation RP, Du RP comme vous en avez jamais VU
En Construction | Ouverture Beta Bientôt