19.04.2015, 02:48
Hello guys...
I have been working on this thing for a long time now but still i can't do it...
What i'm trying to do is to get the last 10 players visited a house, So on i made it but all houses have one list.
So what im asking for is if someone can tell me how to make it each house has its own list.
Code:
Top:
When someone visits
Saving data
When i show the visitors
Thanks...
I have been working on this thing for a long time now but still i can't do it...
What i'm trying to do is to get the last 10 players visited a house, So on i made it but all houses have one list.
So what im asking for is if someone can tell me how to make it each house has its own list.
Code:
Top:
Код:
#define MAX_VISITORS_STORE (10) new Rstring[128],Visitors[MAX_VISITORS_STORE][128];
Код:
CallLocalFunction("StoreVisitor", "d",playerid); LastVisitedHouse[playerid] = id;
Код:
forward StoreVisitor(playerid); public StoreVisitor(playerid) { new year,month,day,hour,minute,second,RName[MAX_PLAYER_NAME]; GetPlayerName(playerid,RName,MAX_PLAYER_NAME); getdate(year,month,day); gettime(hour,minute,second); for(new i = 0; i < MAX_VISITORS_STORE-1; i++) Visitors[i] = Visitors[i+1]; format(Rstring,sizeof(Rstring),"- [%d/%d/%d] [%d:%d] %s",day,month,year,hour,minute,RName); Visitors[MAX_VISITORS_STORE-1] = Rstring; }
Код:
new count; if(listitem == 0) { for(new i = 0; i < MAX_VISITORS_STORE; i++;) { if(strlen(Visitors[i]) > 0) { SendClientMessage(playerid,-1,Visitors[i]); count++; } } if(count == 0) SendClientMessage(playerid,green,"No one have visited you!"); }