Giving players with jobs an item after 1 day?
#1

Okay i have an RPG server and im asking how to check when a person last logs in and buys an item, then when he buys it, he has to wait 1 more day and he can get it again. How do i make this?

NOTE: i know i can just add this:
pawn Код:
new year,month,day,hour,minute,second;
and then...

pawn Код:
getdate(year,month,day);
gettime(hour,minute,second);
But i dunno the rest ! Please help.
Reply
#2

pawn Код:
if(hour==12.. blabla
Reply
#3

I don't get it, i can save, but how do i disallow them to get the item again before 1 day?

is it this? if(!day+1) return SendClientMessage(playerid,color,"[ ! ] Cannot get another item today, come back tomorrow"); ?
Reply
#4

pawn Код:
if (!strcmp("2", tmp, true)) if(Logged[playerid] == 1)
    {
    new year,month,day;
    if((getdate(year,month,day)-LastEcard[playerid]) < 1)
    {
    format(string, 128, "[ ! ] You have to wait %d days before you can get another Item !", (1-(getdate(year,month,day)-LastItem[playerid])));
    SendClientMessage(playerid, c_r, string); return 1;
    }
    if(GetPlayerJobID(playerid) == 9) return 0;
    if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid,c_r,"[ ! ] You need $10 to buy an item !");
    GivePlayerItem(playerid,1);
    SendClientMessage(playerid,COLOR_GREEN,"[ ! ] You have gotten 1 item!");
    GivePlayerMoney(playerid,-10);
    LastItem[playerid] == getdate(year,month,day);
    return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)