[POMOC]Happy Hours

Započeo xZone, Januar 01, 2014, 17:45:30 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Skripta koju koristim:geforce
Detaljan opis problema:kako napravit happy hours da mogu komandom ukljucit i iskljucit duple respekte, samo strcmp mi pisite nista zcmd ycmgdkxžaflćd
Dio skripte:eo payday
public PayDay(playerid)
{
new string[300],
    account,
interest,
total,
lost,
earn,
key,
aptkey,
tmpintrate,
Hour,
Minute,
Second,
Year,
Month,
Day,
rata,
ukupno,
rent = 0;

if(IsPlayerConnected(playerid))
{
         if(PlayerInfo[playerid][pLevel] > 0)
         {

new playername[MAX_PLAYER_NAME];

GetPlayerName(playerid, playername, sizeof(playername));
account = PlayerInfo[playerid][pAccount];
key = PlayerInfo[playerid][pPhousekey];
            aptkey = PlayerInfo[playerid][pApartment];

          if(PlayerInfo[playerid][pHeroinIndicator] > 0)
          {
        PlayerInfo[playerid][pHeroinIndicator] -= 10;//Heroin indikator se smanjuje za 10.Tako da ako igrac uzima heroin,ali ne precesto, ne mora nuzno znacit da ce bit ovisnik
}
        if(PlayerInfo[playerid][pCigareteIndicator] > 0)
        {
        PlayerInfo[playerid][pCigareteIndicator] -= 10;//Isto vrijedi za cigarete
}
        if(PlayerInfo[playerid][pCrackIndicator] > 0)
        {
        PlayerInfo[playerid][pCrackIndicator] -= 10;//Isto vrijedi za crack
}
if(PlayerInfo[playerid][pHeroinUsed] > 0)
{
PlayerInfo[playerid][pHeroinUsed] -= 1;
}
if(PlayerInfo[playerid][pCrackUsed] > 0)
{
PlayerInfo[playerid][pCrackUsed] -= 1;
}
if(PlayerInfo[playerid][pCigareteUsed] > 0)
{
PlayerInfo[playerid][pCigareteUsed] -= 1;
}
if(key != 255)
{
rent = HouseInfo[key][hRent];

if(strcmp(playername, HouseInfo[key][hOwner], true) == 0)
rent = 0;
else if(rent > SafeGetPlayerMoney(playerid))
{
PlayerInfo[playerid][pPhousekey] = 255;
SendClientMessage(playerid, COLOR_RED, "Izbaceni ste jer niste mogli platit cijenu najma kuce.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings] + rent;
}
if(aptkey != 255)
{
rent = ApartmentInfo[aptkey][aRent];

if(strcmp(playername, ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acOwner], true) == 0)
rent = 0;
else if(rent > SafeGetPlayerMoney(playerid))
{
PlayerInfo[playerid][pApartment] = 255;
ApartmentInfo[aptkey][aUsed] = 0;
strmid(ApartmentInfo[aptkey][aUser], "No-one", 0, strlen("No-one"), 255);
SendClientMessage(playerid, COLOR_RED, "Izbaceni ste jer niste mogli platiti cijenu najma sobe.");
SaveApartments();
rent = 0;
}
ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acTill] = ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acTill] + rent;
}
if (key != 255 && strcmp(playername, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[playerid][pAccount] > 1000000)
{
        if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = intrate + 3;
else
    tmpintrate = intrate;
}
else
{
        if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = intrate + 4;
else
    tmpintrate = intrate + 1;
}
}
else
{
if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = 3;
else
    tmpintrate = 1;
}
if(PlayerInfo[playerid][pDonateRank] >= 2)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 2;

PlayerInfo[playerid][pPayCheck] += bonus;
}
if(PlayerInfo[playerid][pDignutKredit] > 0)
{
                if(PlayerInfo[playerid][pDignutKredit] == 1)
                {
                    if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 50;
else
rata = 0;
}
else if(PlayerInfo[playerid][pDignutKredit] == 2)
{
if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 100;
else
rata = 0;
}
else if(PlayerInfo[playerid][pDignutKredit] == 3)
{
    if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 250;
else
rata = 0;
}
/* else if(PlayerInfo[playerid][pDignutKredit] == 4)
{
    if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 600;
else
rata = 0;
} */
else
rata = 0;
}
gettime(Hour, Minute, Second);
getdate(Year, Month, Day);

Tax += TaxValue;
ukupno = TaxValue+rata;
PlayerInfo[playerid][pAccount] -= ukupno;

new checks = PlayerInfo[playerid][pPayCheck] + random(50),
    ebill = 0;

if(PlayerInfo[playerid][pPhousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255)
{
    ebill = (PlayerInfo[playerid][pAccount] / 10000) * (PlayerInfo[playerid][pLevel]);
    if(PlayerInfo[playerid][pAccount] > 0)
    {
     PlayerInfo[playerid][pAccount] -= ebill;
     Proracunsys[ProracunAmmount] += ebill-50;
     //SBizzInfo[4][sbTill] += ebill;
    }
}
            PlayerInfo[playerid][pTookDrugs] = 0;
            SetPVarInt(playerid, "FreeWorks", 6);
            SetPVarInt(playerid, "DutySystem", 1);
PlayerInfo[playerid][pPayDayMoney] += checks;
BizzInfo[3][bTill] += rata;
SaveProperty();
SaveGangs();
SaveProracun();

new money = SafeGetPlayerMoney(playerid);

interest = (PlayerInfo[playerid][pAccount] / 1000) * (tmpintrate);
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pRate]++;
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pAccount] = account+interest;
earn = checks + interest;
lost = TaxValue + ebill + rent + rata;
total = earn - lost;
if(PlayerInfo[playerid][pRate] >= 251)
{
                PlayerInfo[playerid][pRate] = 0;
                PlayerInfo[playerid][pDignutKredit] = 0;
                SendClientMessage(playerid, COLOR_NICERED, "Upravo ste otplatili zadnju ratu kredita! Mozete dignuti novi kredit!");
}

// PayDay Text Draw
format(string, sizeof(string), "~w~%02d/%02d/%d, %02d:%02d:%02d~n~ ~n~IZNOS PLACE~n~ ~y~Radna Knjizica: ~w~%d~g~$~n~ ~w~BANKOVNI RACUN~n~ ~y~Iznos: ~w~%d~g~$~n~ ~y~Kamatna stopa: ~w~0.%d~n~ ~y~Iznos kamate: ~w~%d~g~$",
Day,
Month,
Year,
Hour,
Minute,
Second,
checks,
account,
tmpintrate,
interest);

TextDrawSetString(PayCheckTextDraw[playerid], string);
TextDrawShowForPlayer(playerid, PayCheckTextDraw[playerid]);

// PayDay Total Text Draw
            format(string, sizeof(string), "~w~TROSKOVI~n~ ~y~Racun struje: ~r~-%d~g~$~n~ ~y~Rent: ~r~-%d~g~$~n~ ~y~Porez: ~r~-%d~g~$~n~ ~y~Kredit: ~r~-%d~g~$~n~ ~w~NOVI IZNOS~n~ ~y~Banka: ~w~%d~g~$~n~ ~y~Gotovina: ~w~%d~g~$~n~ ~y~Ukupan profit: ~w~%d~g~$~n~ ~w~Pritisnite ~y~ENTER ~w~za ~n~zatvaranje.",
            ebill,
rent,
TaxValue,
rata,
PlayerInfo[playerid][pAccount],
money,
total);

TextDrawSetString(PayCheckTextDrawTotal[playerid], string);

TextDrawShowForPlayer(playerid, PayCheckTextDrawTotal[playerid]);
SetPVarInt(playerid, "PayDayTextDrawShown", 1);

rent = 0;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PovecajPVarInt(playerid, "ConnectTime", 1);
if(PlayerInfo[playerid][pJob] == 53)
{
                if(GetPVarInt(playerid, "ConnectTime") > 35)
{
    PlayerInfo[playerid][pJob] = 0;
    SendClientMessage(playerid, COLOR_LIGHTRED, "Dobio si otkaz jer vise nisi novi gradjanin, uzmi novi posao!");
}
}
            PlayerInfo[playerid][pKosa] += 1;
            if(PlayerInfo[playerid][pKosa] >= 30)
            {
SendClientMessage(playerid, COLOR_NICEYELLOW, "Narasla vam je kosa poprilicno, a o bradi da ne govorimo");
SendClientMessage(playerid, COLOR_NICEYELLOW, "Mozda je vrijeme za sisanje konacno?");
}
if(PlayerInfo[playerid][pJob] > 0)
     PlayerInfo[playerid][pContractTime] ++;

if(PlayerInfo[playerid][pDonateRank] == 2)
{
PlayerInfo[playerid][pPayDayHad] += 1;
         if(PlayerInfo[playerid][pPayDayHad] >= 10)
     {
     PlayerInfo[playerid][pExp]++;
     PlayerInfo[playerid][pPayDayHad] = 0;
     }
}
else if(PlayerInfo[playerid][pDonateRank] == 3)
{
PlayerInfo[playerid][pPayDayHad] += 1;
         if(PlayerInfo[playerid][pPayDayHad] >= 5)
     {
     PlayerInfo[playerid][pExp]++;
     PlayerInfo[playerid][pPayDayHad] = 0;
     }
}
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /
Poslednja Izmena: Januar 01, 2014, 19:07:39 POSLE PODNE od Mangusta

new bool: HappyHours;
if( strcmp ( cmdtext, "/happyhours", true ) == 0 )
{
    if( IsPlayerAdmin ( playerid ) )
    {
        new pName[ MAX_PLAYER_NAME ];
        GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
        new string[ 128 ];
        if( !HappyHours )
        {
            HappyHours = true;
         
            format ( string, sizeof string, "Admin %s je ukljucio duple respekte !", pName );
            SendClientMessageToAll( 0xFFFFFFAA, string );
        }
        else
        {
            HappyHours = false;
       
            format( string, sizeof string, "Admin %s je iskljucio duple respekte !", pName );
            SendClientMessageToAll( 0xFFFFFFAA, string );
        }
    }
    else
    {
        SendClientMessage(playerid, 0xAFAFAFAF, "    Niste autorizovani !");
    }
    return 1;
}


Citat: Mangusta poslato Januar 01, 2014, 18:36:06 POSLE PODNE
i to bi trebalo radit da na svaki payday dode dupli resekt svim igracima


Ako kod paydaya postavis provjeru trebalo bi..

Ne mogu ti sve napisat, mislim mogu al necu skontaj malo matematika/logika cista


Citat: Mangusta poslato Januar 01, 2014, 19:06:17 POSLE PODNE
os ti mene prcit il ces pomoc
¸


Ne bahati se ti trazis skriptera ovo je Razgovor u vezi PAWN skriptanja
nismo mi pravljaci skripte.



ali svejedno tako nes nikad nista naucit pa evo ti

if(HappyHours) array[id][varijabla] += 2;
else array[id][varijabla] ++;

bravo, je ovo razgovor i pita san kako cu napravit komandu a ne oceli mi ko drzat repeticije matematike il tvoje logike