SA-MP Forums Archive
Sell Property Bug ... Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sell Property Bug ... Help (/showthread.php?tid=81916)



Sell Property Bug ... Help - steven_italy - 15.06.2009

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 .-.


Re: Sell Property Bug ... Help - steven_italy - 15.06.2009

up


Re: Sell Property Bug ... Help - kaisersouse - 15.06.2009

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