Listing Property's
#1

I'm trying to make a /myproperties command which lists all the property's I own. I only own one so far, when I type /myproperties, it lists 3 and it just saids: "Property Name: " Code is below:
Код:
if (strcmp(cmd, "/myproperties", true) ==0 )
{
	new count = 0;
	for(new i; i < sizeof(PropertyInfo); i++)
  	{
	  if(!strcmp(PropertyInfo[i][Name], GetPlayerNameEx(playerid), true))
      {
	     count++;
	     format(string, 256, "Property Name: %s", PropertyInfo[i][Name]);
		 SendClientMessage(playerid, COLOR_RED, string);
      }
	}
	return 1;
}
Reply
#2

This is because your property owners name string is empty.

pawn Код:
if (strcmp(cmd, "/myproperties", true) ==0 )
{
    new count = 0;
    for(new i; i < sizeof(PropertyInfo); i++)
    {
        if(strlen(PropertyInfo[i][Name]) != 0 && !strcmp(PropertyInfo[i][Name], GetPlayerNameEx(playerid), true))
        {
            count++;
            format(string, 256, "Property Name: %s", PropertyInfo[i][Name]);
            SendClientMessage(playerid, COLOR_RED, string);
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by MadeMan
This is because your property owners name is empty.
Quote:
Originally Posted by Eric_
I only own one so far.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)