Sell Property Bug ... Help
#1

This is my sellproperty command that i use on my property system
Код:
	if(strcmp(cmd, "/sellproperty", true) == 0)
	{
	  new str[128];
	  #if ENABLE_LOGIN_SYSTEM == 1
		if(Logged[playerid] == 0)
		{
		  format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
			SendClientMessage(playerid, 0xFF0000AA, str);
			return 1;
		}
		#endif
		new propid = IsPlayerNearProperty(playerid);
		if(propid == -1)
		{
			SendClientMessage(playerid, 0xFF0000AA, "PROPERTY: You're not close enough to a property");
			return 1;
		}
		if(PropInfo[propid][PropIsBought] == 1)
		{
			new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
			if(ownerid != playerid)
			{
			  SendClientMessage(playerid, 0xFF0000AA, "PROPERTY: You don't own this property!");
			  return 1;
			}
		}
		new pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Nobody");
		PropInfo[propid][PropIsBought] = 0;
		PropInfo[propid][PropUnbuyableTime] = 0;
		GivePlayerMoney(playerid, (PropInfo[propid][PropValue]/2));
		format(str, 128, "PROPERTY: You have sold your property \"%s\" for 50 percents of its value: $%d.", PropInfo[propid][PropName], PropInfo[propid][PropValue]/2);
    SendClientMessage(playerid, 0xFF0000AA, str);
    format(str, 128, "PROPERTY: %s has sold the property \"%s\".", pName, PropInfo[propid][PropName]);
    SendClientMessageToAllEx(playerid, 0xFF0000AA, str);
    PlayerProps[playerid]--;
    EarningsForPlayer[playerid] -= PropInfo[propid][PropEarning];
		return 1;
	}
so if u don't own a property, it must say PROPERTY: You don't own this property! but dont appen this, it sell the property and give to the player the money for the selled property and then in the property info he say that i have -1 property. how can i fix .-.
Reply
#2

up
Reply
#3

ask in whatever topic for the gamemode (GF, etc) that this function came from.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)