SA-MP Forums Archive
[Little help] 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)
+--- Thread: [Little help] Help (/showthread.php?tid=350623)



[Little help] Help - David Tennant - 13.06.2012

When i /createhouse i can buy it, but i want when i /createhouse appers little green house... And when i buy it (/buyhouse) appers little blue house... Anyone help?


Re: [Little help] Help - rachit_rocks - 13.06.2012

it can not be helped..


Re: [Little help] Help - Littlehelper - 13.06.2012

What?
Show us the code, we are not physicians.


Re: [Little help] Help - iggy1 - 13.06.2012

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
Show us the code, we are not physicians.
What does being a doctor have to do with scripting lol

http://en.wikipedia.org/wiki/Physician

You mean psychic.


Re: [Little help] Help - Dziugsas - 13.06.2012

When you create a house insert code like this : CreateDynamicPickup(EnterX, EnterY, EnterZ, 31, 0, 0, 0, -1, 150.0); same thing when buying...


Re: [Little help] Help - Littlehelper - 13.06.2012

Quote:
Originally Posted by iggy1
Посмотреть сообщение
What does being a doctor have to do with scripting lol

http://en.wikipedia.org/wiki/Physician

You mean psychic.
Reading the minds and shit.


Re: [Little help] Help - David Tennant - 13.06.2012

Код:
COMMAND:buycell(playerid, params[])
{
	new str[128];
    if(PlayerStat[playerid][HasCell] == 1) return SendClientMessage(playerid, GREY, "Vec imas zatvor, ako zelis prodati /sellcell ili /sellcellto.");
    for(new c = 0; c < MAX_CELLS; c++)
    {
		if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]))
	    {
            if(CellStat[c][Owned] == 1) return SendClientMessage(playerid, GREY, "Ovaj zatvor nije dostupan.");
            {
				if(PlayerStat[playerid][Money] >= CellStat[c][CellPrice])
				{
					CellStat[c][Owned] = 1;
					PlayerStat[playerid][HasCell] = 1;
					PlayerStat[playerid][Cell] = c;
					GiveMoney(playerid, - CellStat[c][CellPrice]);
					format(CellStat[c][CellOwner], 60, "%s", GetOOCName(playerid));
					format(str, sizeof(str), "Vlasnik ovog zatvora ID %d\nOwner: %s", c, CellStat[c][CellOwner]);
                    Update3DTextLabelText(CellStat[c][TextLabel], RED, str);
                    DestroyDynamicPickup(CellStat[c][PickupID]);
                    CellStat[c][PickupID] = CreateDynamicPickup(1272, 23, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ], 0, -1, -1, 100.0);
					format(str, sizeof(str), "Cestitamo! Sada imate svoj vlastiti zatvor (ID: %d).", c);
					SendClientMessage(playerid, GREEN, str);
					SaveCell©;
				}
				else
				{
                    format(str, sizeof(str), "Nemozes si priustiti $%d da kupis vlastiti zatvor.", CellStat[c][CellPrice]);
					SendClientMessage(playerid, GREY, str);
				}
            }
        }
    }
    return 1;
This is when you buy it (my server is prison, and you are buying cells )

This is when you create

Код:
COMMAND:createcell(playerid, params[])
{
    new Price, str[128];
	if(PlayerStat[playerid][AdminLevel] < 5) return SendClientMessage(playerid, GREY, "You can't use this command.");
    if(sscanf(params,"d", Price))return SendClientMessage(playerid, GREY, "USAGE: /createcell [price] (Stand up infron of the cell then use this command)");
    if(Server[LoadedCells] > MAX_CELLS) return SendClientMessage(playerid, GREY, "You can't create cells anymore (Max Number of Cells is 100)");
	new Float: PosX, Float: PosY, Float: PosZ;
	GetPlayerPos(playerid, PosX, PosY, PosZ);
	CreateCell(Price, PosX, PosY, PosZ, PosX -1.7, PosY, PosZ);
	SendClientMessage(playerid, GREY, "You have successfully created a cell.");
	format(str, sizeof(str), "Admin %s has created a new cell.", GetOOCName(playerid));
    AdminActionLog(str);
    return 1;
}



Re: [Little help] Help - -CaRRoT - 13.06.2012

PHP код:
CellStat[c][PickupID] = CreateDynamicPickup(127223CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ], 0, -1, -1100.0); 
PHP код:
CreateDynamicPickup(127223bla bla bla); 
1272 = Blue house

Change it to :

1273 = Green House


Re: [Little help] Help - David Tennant - 13.06.2012

Breto thx, but can you copy my code and then put yours code, beacuse i am begginer in scripting, i try but error comes out... If put yours code into my code and post it?