house thingy
#1

hey,i dont know how to fix this,i added some lines under the ongamemodeinit,it should load houses like this from playerinfo,it should check if player has house and if he has,it should create it,even if the player aint logged in

Код:
public OnGameModeInit()
{
	for(new v; v < MAX_PLAYERS; v++)
	{
			if(PlayerInfo[v][pHouseAccepted] > 0)
		{
		    new hnametag[64];
		    new hloctag[64];
		    //pickup
			HousePickupIDTemp[v] = CreatePickup(1273,1,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]);
			printf("PickupID: %d", HousePickupIDTemp[v]);
		    //nametag
		    strmid(hnametag, PlayerInfo[v][pHouseTag], 0, strlen(PlayerInfo[v][pHouseTag]), 255);
			House3dTextID[v] = Create3DTextLabel(hnametag,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.88,20.0,0,1);
			printf("House3dTextID: %d", _:House3dTextID[v]);
			//owner
			new string[256];
			format(string, sizeof(string),"Owner: %s", PlayerName(v));
			HouseTextOwnerID[v] = Create3DTextLabel(string,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.74,20.0,0,1);
			strmid(PlayerInfo[v][pHouseOwnerTag], PlayerName(v), 0, strlen(PlayerName(v)), 255);
			printf("HouseTextOwnerID: %d", _:HouseTextOwnerID[v]);
			//location
			strmid(hloctag, PlayerInfo[v][pHouseLocTag], 0, strlen(PlayerInfo[v][pHouseLocTag]), 255);
			format(string, sizeof(string),"Location: %s", hloctag);
			HouseTextLocationID[v] = Create3DTextLabel(string,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.60,20.0,0,1);
			printf("HouseTextLocationID: %d", _:HouseTextLocationID[v]);
			//vehicle
			HouseVehicleIDTemp[v] = CreateVehicle(PlayerInfo[v][pHouseCarModel],PlayerInfo[v][pHouseCarX],PlayerInfo[v][pHouseCarY],PlayerInfo[v][pHouseCarZ],PlayerInfo[v][pHouseCarFacing],PlayerInfo[v][pHouseCarColor],PlayerInfo[v][pHouseCarColor2], 900);
			if(PlayerInfo[v][hVehLock] > 0)
			{
				LockCar(HouseVehicleIDTemp[v]);
			}
		}
		}
....
Reply


Messages In This Thread
house thingy - by WardenCS - 24.01.2011, 18:42
Re: house thingy - by WardenCS - 25.01.2011, 07:43
Re: house thingy - by Fool - 25.01.2011, 09:03
Re: house thingy - by Vince - 25.01.2011, 09:28
Re: house thingy - by WardenCS - 25.01.2011, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)