Visitors
#1

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:
Код:
#define     MAX_VISITORS_STORE  (10)

new Rstring[128],Visitors[MAX_VISITORS_STORE][128];
When someone visits
Код:
CallLocalFunction("StoreVisitor", "d",playerid);
LastVisitedHouse[playerid] = id;
Saving data
Код:
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;
}
When i show the visitors
Код:
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!");
		}
Thanks...
Reply


Messages In This Thread
Visitors - by RowdyrideR - 19.04.2015, 02:48
Re: Visitors - by Fel486 - 19.04.2015, 04:35
Re: Visitors - by RowdyrideR - 19.04.2015, 12:09
Re: Visitors - by mamorunl - 19.04.2015, 15:56
Re: Visitors - by Fel486 - 19.04.2015, 17:10
Re: Visitors - by RowdyrideR - 19.04.2015, 23:05

Forum Jump:


Users browsing this thread: 1 Guest(s)