[Dini] INI-files easy! (1.6, 16th Sep 2008)
#18

Thanx, but how is it how is save the players name after the property because every time i try i get the tag mismatch symbol

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	new playermoney;
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new pname[256];
	new cmd[256];
	new giveplayerid, moneys, idx;
	new tmp[256], tmp2[256];
	new playername[MAX_PLAYER_NAME];

	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/buy", true) == 0) {
		new property=999;
    GetPlayerName(playerid, pname, sizeof(pname));
		if(IsPlayerInCheckpoint(playerid)) {
			switch (playerCheckpoint[playerid]) {
				case CP_AMMU:{
				  property = P_AMMU;
				}

			}

			if(property==999) {
				SendClientMessage(playerid, COLOR_YELLOW, "You need to be in a property checkpoint to /buy it.");
				return 1;
			}

//			property--;

			if(dini_Exists(udb_encode("Propertys.ini"))) {
			tmp = dini_Get("Propertys.ini", propertyNames[property]);
			format(string, sizeof(string), "This Property belongs to %s", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
			}


			if(GetPlayerMoney(playerid) < propertyValues[property]) {
				SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this property.");
				return 1;
			}

			if(propertyOwner[property]==playerid) {
				SendClientMessage(playerid, COLOR_RED, "You already own this property.");
				return 1;
			}

			GivePlayerMoney(playerid, 0-propertyValues[property]);

			propertyOwner[property]=playerid;
			
			format(string, sizeof(string), "You have purchased the %s!", propertyNames[property]);
			SendClientMessage(playerid, COLOR_GREEN, string);
                    dini_IntSet("Propertys.ini", propertyNames[property], pname);
			}
  		return 1;
	}
Reply


Messages In This Thread
[Dini] INI-files easy! (1.6, 16th Sep 2008) - by DracoBlue - 14.05.2006, 18:03
Re: [Dini] INI-files easy! - by caytchen - 14.05.2006, 18:05
Re: [Dini] INI-files easy! - by DracoBlue - 14.05.2006, 18:06
Re: [Dini] INI-files easy! - by Slick - 15.05.2006, 09:20
Re: [Dini] INI-files easy! - by Masta - 29.05.2006, 01:18
Re: [Dini] INI-files easy! - by DON_FAF - 29.05.2006, 01:57
Re: [Dini] INI-files easy! - by Masta - 29.05.2006, 03:56
Re: [Dini] INI-files easy! - by DracoBlue - 29.05.2006, 09:47
Re: [Dini] INI-files easy! - by Masta - 01.06.2006, 02:01
Re: [Dini] INI-files easy! - by ProRaiL - 15.07.2006, 14:12
Re: [Dini] INI-files easy! - by ProRaiL - 15.07.2006, 14:38
Re: [Dini] INI-files easy! - by ProRaiL - 16.07.2006, 05:34
Re: [Dini] INI-files easy! - by [BDC]Scarface - 16.07.2006, 13:58
Re: [Dini] INI-files easy! - by DracoBlue - 16.07.2006, 17:52
Re: [Dini] INI-files easy! - by tosscops - 17.07.2006, 13:55
Re: [Dini] INI-files easy! - by {XN}BigPaddy - 16.08.2006, 22:27
Re: [Dini] INI-files easy! - by DracoBlue - 17.08.2006, 08:32
Re: [Dini] INI-files easy! - by {XN}BigPaddy - 17.08.2006, 09:22
Re: [Dini] INI-files easy! - by DracoBlue - 17.08.2006, 09:43
Re: [Dini] INI-files easy! - by metalpenguin - 17.08.2006, 11:16
Re: [Dini] INI-files easy! - by Tratulla - 01.09.2006, 14:41
Re: [Dini] INI-files easy! - by DracoBlue - 01.09.2006, 14:46
Re: [Dini] INI-files easy! - by Tratulla - 01.09.2006, 14:49
Re: [Dini] INI-files easy! - by DracoBlue - 01.09.2006, 15:45
Re: [Dini] INI-files easy! - by Crazycamel - 30.09.2006, 11:54
Re: [Dini] INI-files easy! - by DracoBlue - 30.09.2006, 12:02
Re: [Dini] INI-files easy! - by Crazycamel - 30.09.2006, 12:52
Re: [Dini] INI-files easy! - by DracoBlue - 30.09.2006, 13:03
Re: [Dini] INI-files easy! - by Crazycamel - 30.09.2006, 13:20
Re: [Dini] INI-files easy! - by DracoBlue - 30.09.2006, 13:29
Re: [Dini] INI-files easy! (1.6, 16th Sep 2008) - by Brezon - 11.07.2014, 11:23

Forum Jump:


Users browsing this thread: 2 Guest(s)