Jump to content

Jak na domy pomocí jednoho řádku.


AvestX

Recommended Posts

  • 1 month later...
  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Vedel by nekdo pls co s tim?

Error:

C:\Users\MM\Desktop\HouseSystem.pwn(109) : error 017: undefined symbol "PlayerName"

Diky

 

stock PlayerName(playerid)
{
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}

Link to comment
Share on other sites

Zdravím mám jeden malý dotaz. To je jedno, kam dám ty souřadnice spawnu? Že já jsem dal souřadnice a interier a propadl jsem se do neznáma. Děkuji

 

Pokud si dal správný souřadnice do OnGameModeInit tak by to mělo jít.. jestli tě to hodí do neznáma po spawnu do interiéru tak si najdi na wiki souřadnice interierů..

Link to comment
Share on other sites

Guest Punkevník
Vedel by nekdo pls co s tim?

Error:

C:\Users\MM\Desktop\HouseSystem.pwn(109) : error 017: undefined symbol "PlayerName"

Diky

 

grubb

 

stock PlayerName(playerid)
{
new name[24];
GetPlayerName(playerid, name, 24);
return name;
}

Hore do modu ;)

 

SP Styl3r

Link to comment
Share on other sites

  • 2 months later...

Ako spravit aby ukladalo majitelov domov aj po restarte servera ???

 

-- sob 12. úno 2011 3:24:57 --

 

Tak :d Avest-X je tu znovu se svím trapným TuTem jak na dům v podobě includu.

No :lol: můžete si to dát do includu :d ale já to rači v modu, mam v tom pak přehled.

:boss:


Do modu si dejte tyhle řádky ( Už je tady jeden TuT odemě a tam je to všechno popsaný ).

 

#include

#define MAX_HOUSES 50

//-------------------------------------|

enum HOUSE_DATA

{

Float:p_X,

Float:p_Y,

Float:p_Z,

Float:i_X,

Float:i_Y,

Float:i_Z,

iin,

Cena,

Vlastnik,

Dialog,

Zamek

}

new HouseInfo[MAX_HOUSES][HOUSE_DATA];

new HouseCount = 0;

new MajitelDomu[MAX_HOUSES][MAX_PLAYERS];

//------------------------------------|

forward GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z);

forward IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius);

forward AddHouse(Float:pX, Float:pY, Float:pZ, Float:iX, Float:iY, Float:iZ, ii, Cenik, iddialogu);

//------------------------------------|

public AddHouse(Float:pX, Float:pY, Float:pZ, Float:iX, Float:iY, Float:iZ, ii, Cenik, iddialogu)

{

if(HouseCount < MAX_HOUSES)

{

HouseInfo[HouseCount][p_X] = pX;

HouseInfo[HouseCount][p_Y] = pY;

HouseInfo[HouseCount][p_Z] = pZ;

 

HouseInfo[HouseCount][i_X] = iX;

HouseInfo[HouseCount][i_Y] = iY;

HouseInfo[HouseCount][i_Z] = iZ;

HouseInfo[HouseCount][iin] = ii;

 

HouseInfo[HouseCount][Cena] = Cenik;

 

HouseInfo[HouseCount][Vlastnik] = 0;

HouseInfo[HouseCount][Zamek] = 0;

 

CreatePickup(1273,1,pX, pY, pZ);

HouseInfo[HouseCount][Dialog] = iddialogu;

HouseCount ++;

}else{

print("");

}

return 1;

}

//------------------------------------|

public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)

{

if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius) return 1;

return 0;

}

//------------------------------------|

public GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z)

{

new Float:x1,Float:y1,Float:z12,Float:tmpdis;

GetPlayerPos(playerid,x1,y1,z12);

tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)

+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z12)),2));

return floatround(tmpdis);

}

//------------------------------------|

public OnPlayerPickUpPickup(playerid, pickupid)

{

for(new h=0;h

{

if(IsPlayerInSphere(playerid,HouseInfo[h][p_X],HouseInfo[h][p_Y],HouseInfo[h][p_Z],2) == 1)

{

ShowPlayerDialog(playerid,HouseInfo[h][Dialog],DIALOG_STYLE_LIST,"Dům","Koupit\nProdat\nZamknout\nOdemknout\nInformace o domu\nVstoupit","Použít","Nic");

}

}

return 1;

}

//------------------------------------|

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

{

if(newkeys == KEY_WALK)

{

for(new h=0;h

{

if(IsPlayerInSphere(playerid,HouseInfo[h][i_X],HouseInfo[h][i_Y],HouseInfo[h][i_Z],10) == 1)

{

SetPlayerPos(playerid,HouseInfo[h][p_X],HouseInfo[h][p_Y],HouseInfo[h][p_Z]);

SetPlayerInterior(playerid,0);

}

}

}

return 1;

}

//------------------------------------|

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

for(new h=0;h

{

if(dialogid == HouseInfo[h][Dialog])

{

if(response == 1)

{

if(listitem == 0)

{

if(GetPlayerMoney(playerid) <= HouseInfo[h][Cena]) return SendClientMessage(playerid, 0xFFFFFFFF, "Máš málo peněz !");

if(HouseInfo[h][Vlastnik] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Tento dům již někdo vlastní !");

HouseInfo[h][Vlastnik] = 1;

MajitelDomu[h][playerid] = 1;

GivePlayerMoney(playerid, -HouseInfo[h][Cena]);

SendClientMessage(playerid, 0xFFFFFFFF, "Pořidil jsi si dům !");

}

else if(listitem == 1)

{

if(MajitelDomu[h][playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Tento dům není tvůj !");

HouseInfo[h][Vlastnik] = 0;

MajitelDomu[h][playerid] = 0;

GivePlayerMoney(playerid, HouseInfo[h][Cena]);

SendClientMessage(playerid, 0xFFFFFFFF, "Dům prodán, byla ti vrácena cena !");

}

else if(listitem == 2)

{

if(MajitelDomu[h][playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Tento dům není tvůj !");

HouseInfo[h][Zamek] = 0;

SendClientMessage(playerid, 0xFFFFFFFF, "Dům zamknut !");

}

else if(listitem == 3)

{

if(MajitelDomu[h][playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Tento dům není tvůj !");

SendClientMessage(playerid, 0xFFFFFFFF, "Dům odemknut !");

HouseInfo[h][Zamek] = 1;

}

else if(listitem == 4)

{

SendClientMessage(playerid, 0xFFFFFFFF, "Informace o domu:");

if(HouseInfo[h][Zamek] == 0)

{

SendClientMessage(playerid,0xFFFFFFFF,"Zámek: Zamknutý.");

}else{

SendClientMessage(playerid,0xFFFFFFFF,"Zámek: Odemknutý.");

}

if (HouseInfo[h][Vlastnik] == 0)

{

SendClientMessage(playerid,0xFFFFFFFF,"K Prodeji: Ano");

}else{

SendClientMessage(playerid,0xFFFFFFFF,"K Prodeji: Ne");

}

}

else if(listitem == 5)

{

if(HouseInfo[h][Zamek] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Tento dům je zamknut !");

SetPlayerPos(playerid, HouseInfo[h][i_X],HouseInfo[h][i_Y],HouseInfo[h][i_Z]);

SetPlayerInterior(playerid, HouseInfo[h][iin]);

SendClientMessage(playerid, 0xFFFFFFFF, "Dům opustíš L.ALT !");

}

}

}

}

return 1;

}

//------------------------------------|

 


Dům uděláte do OnGameModeInt takto:

AddHouse(X, Y, Z, Interior:X, Interior:Y, Interior:Z, ID Interioru, Cena domu, ID Dialogu);

Už to neni přes ty zastaralí menu ale dialogy, musíte nastavit ID dialogu.

takže například:

1546.370,-1365.945,325.204

AddHouse(1546.370,-1365.945,325.204, -2046.791,361.814,64.241, 6, 90000, 60);

 

P.S.: Už to tu je, ale musíte je definovat, tohle je lechčí, no mohl sem to hodit tam :d ale už to bude starej topic, možná už i je.

 

Ako to mam spravit aby sa to ukladalo cez DUDB ? Napriklad ako banka : bank[playerid]=dUserINT(Jmeno(playerid)).("Banka");

 

Skusal som to ale neslo mi to :oops:

Link to comment
Share on other sites

  • 3 months later...

můžu se zeptat? neví někdo kde bych sehnal interiery domů?

ve windows serveru něco je, ale nevim jestli to je i interiér..

1273, 2317.130615, 692.398498, 11.460937, 182.779815, 114, 1 ; // LV house 1 (Kye) poradí mi někdo, prosím?

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Proč mi to vyhazuje tolik warningu ?

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(454) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(455) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(456) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(457) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(458) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(459) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(460) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(461) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(462) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(463) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(464) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(465) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(466) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(467) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(468) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(469) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(470) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(471) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(472) : warning 215: expression has no effect

C:\Documents and Settings\Svoboda\Plocha\crazy-7-7.pwn(473) : warning 215: expression has no effect

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

20 Warnings.

Řádky:

	
AddHouse(-2112.4875,745.2772,69.5625, -2046.791,361.814,64.241, 6, 3000000, 60);

AddHouse(-2094.3840,745.7846,69.5625, 225.630997,7022.479980,1084.069946 , 	7 , 4000000, 60);

AddHouse(-2112.3997,821.9222,69.5625, 385.803986,1471.769897,1080.209961 , 15, 1000000, 60);

AddHouse(-2094.0750,821.9000,69.5625, 235.508994,1189.169897,1080.339966 , 3, 3000000, 60);

Takhle mám všech 20 Warningu

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...