Jump to content

Cerere Tutorial


iHate.

Recommended Posts

Comanda toata nu o sa ti-o faca nimeni.

Ea variaza in functie de sistemul tau de case

uite un exemplu:

CMD:createhouse(playerid, params[])
{
	if(AutoData[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xE74C3CFF, "AdminOnly");
	new interior, price;
	if(sscanf(params, "ii", price, interior)) return SendClientMessage(playerid, 0xE74C3CFF, Usage"/createhouse <pret> <id interior>");
    if(!( <= interior <= sizeof(HouseInteriors)-1)) return SendClientMessage(playerid, 0xE74C3CFF, "Interior ID you entered does not exist.");
	new id = Iter_Free(Houses);
	if(id == -1) return SendClientMessage(playerid, 0xE74C3CFF, "You can't create more houses.");
	SetPVarInt(playerid, "HousePickupCooldown", tickcount()+1000);
	format(HouseData[id][Name], MAX_HOUSE_NAME, "De vanzare");
	format(HouseData[id][Owner], MAX_PLAYER_NAME, "-");
	format(HouseData[id][Password], MAX_HOUSE_PASSWORD, "-");
	GetPlayerPos(playerid, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ]);
	HouseData[id][Price] = price;
	HouseData[id][Interior] = interior;
	HouseData[id][LockMode] = LOCK_MODE_NOLOCK;
	HouseData[id][SafeMoney] = ;
	HouseData[id][LastEntered] = ;
    HouseData[id][Save] = true;

    new label[200];
    format(label, sizeof(label), "{FFFFFF}House for Sale\n{FFFFFF}House ID: {7f0a49}%d\n{FFFFFF}Price: {7f0a49}%s{097920}$\n{FFFFFF}[/buyhouse] for buy this house!", id, convertNumber(price));
	HouseData[id][HouseLabel] = CreateDynamic3DTextLabel(label, 0xFFFFFFFF, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ]+0.35, 15.0, .testlos = 1);
	HouseData[id][HousePickup] = CreateDynamicPickup(19523, 1, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ]);
	HouseData[id][HouseIcon] = CreateDynamicMapIcon(HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ], 31, );

	new query[256];
	mysql_format(SQLHandle, query, sizeof(query), "INSERT INTO `houses` SET `ID`='%d', `HouseX`='%f', `HouseY`='%f', `HouseZ`='%f', `HousePrice`='%d', `HouseInterior`='%d'", id, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ], price, interior);
	mysql_tquery(SQLHandle, query, "", "");
	Iter_Add(Houses, id);
	return 1;
}

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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