Jump to content

Problema Stringuri


salexm93

Recommended Posts

Salutare

Se da urmatorul cod :

 new housenear =ReturnNearHouse(playerid,1.5);
	            new string[256];
	            format(string, sizeof (string), "buying house %i",housenear);
	            SendClientMessage(playerid, 0xFFFFFFFF, string);
	            if(HouseInfo[housenear][hStatus]==0&& housenear >-1)
	            {
	                if(PlayerInfo[playerid][pMoney]>=HouseInfo[housenear][hPrice])
	                {
	                    PlayerInfo[playerid][pMoney]  =PlayerInfo[playerid][pMoney]-HouseInfo[housenear][hPrice];
	                    format(string, sizeof (string), "House %i is now yours ,congrats",housenear);
	            		SendClientMessage(playerid, 0xFFFFFFFF, string);
	            		HouseInfo[housenear][hOwner] = PlayerInfo[playerid][pName];
	            		HouseInfo[housenear][hStatus]=2;
	            		PlayerInfo[playerid][pHouse]=housenear;
	            		format(string, sizeof (string),"LOCKED HOUSE\n\nHOUSE NO:{00FF00} %i\n{FFFFFF}OWNER{00FF00}%s\n",HouseInfo[housenear][hID],HouseInfo[housenear][hOwner]);
	            		Update3DTextLabelText(HouseInfo[housenear][h3dtext], 0xFFFFFFFF, string);//1993
	            		SaveHouse(housenear);
	            		SendClientMessage(playerid,-1,string);
	                    return 1;
	                }
	                else
	                {
	                    SendClientMessage(playerid, 0xFFFFFFFF, "Not enough money");
						return 1;
	                }
	            }

Rezultatul : Un amestec intre numele original de la hOwner si numele playerului :

hOwner pentru 0 = stateh1 

hOwner pentru 1 = stateh2 

pName = Khafji

wtf.png.2dbebb58c3c1bc3dce47cad5c2afef4b.png

Edited by salexm93
Link to comment
Share on other sites

37 minutes ago, salexm93 said:

Se poate inchide .

Cautand intr-un gamemode am gasit solutia

strmid(HouseInfo[housenear][hOwner], PlayerInfo[playerid][pName], 0, strlen(PlayerInfo[playerid][pName]), 255);

 

Ca idee ,daca exista vreo metoda mai optima please reply

vezi ca risti sa-ti crape daca schimbi marimea la hOwner

strmid(HouseInfo[housenear][hOwner], PlayerInfo[playerid][pName], 0, strlen(PlayerInfo[playerid][pName]), strlen(HouseInfo[housenear][hOwner]));

also... tu cauti solutia intr-un gamemode in loc sa intelegi logic codul pe care il ai? nu va inteleg ma jur :)))

Link to comment
Share on other sites

  • Mister locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.