SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/08/2019, 12:26 PM   #11
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,120
Reputation: 68
Default Re: TEXTDRAWS AND MAPPINGS

lets search in it, or can u show me that code? I'll try to find it too.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/08/2019, 12:27 PM   #12
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 77
Reputation: 9
Default Re: TEXTDRAWS AND MAPPINGS

LoadHouses() {

if(!fexist("apartments.cfg")) return 1;

new
szFileStr[1024],
File: iFileHandle = fopen("apartments.cfg", io_read),
iIndex;

while(iIndex < sizeof(HouseInfo) && fread(iFileHandle, szFileStr)) {
sscanf(szFileStr, "p<|>iiis[128]s[24]ffffffffiiiiiiiiiiiiiiiiiiffiiiiiiiiiii",
HouseInfo[iIndex][hOwned],
HouseInfo[iIndex][hLevel],
HouseInfo[iIndex][hHInteriorWorld],
HouseInfo[iIndex][hDescription],
HouseInfo[iIndex][hOwner],
HouseInfo[iIndex][hExteriorX],
HouseInfo[iIndex][hExteriorY],
HouseInfo[iIndex][hExteriorZ],
HouseInfo[iIndex][hExteriorR],
HouseInfo[iIndex][hInteriorX],
HouseInfo[iIndex][hInteriorY],
HouseInfo[iIndex][hInteriorZ],
HouseInfo[iIndex][hInteriorR],
HouseInfo[iIndex][hLock],
HouseInfo[iIndex][hRentable],
HouseInfo[iIndex][hRentFee],
HouseInfo[iIndex][hValue],
HouseInfo[iIndex][hSafeMoney],
HouseInfo[iIndex][hPot],
HouseInfo[iIndex][hCrack],
HouseInfo[iIndex][hHeroin],
HouseInfo[iIndex][hMaterials],
HouseInfo[iIndex][hWeapons][0],
HouseInfo[iIndex][hWeapons][1],
HouseInfo[iIndex][hWeapons][2],
HouseInfo[iIndex][hWeapons][3],
HouseInfo[iIndex][hWeapons][4],
HouseInfo[iIndex][hGLUpgrade],
HouseInfo[iIndex][hPickupID],
HouseInfo[iIndex][hCustomInterior],
HouseInfo[iIndex][hCustomExterior],
HouseInfo[iIndex][hExteriorA],
HouseInfo[iIndex][hInteriorA],
HouseInfo[iIndex][hFlag],
HouseInfo[iIndex][hWepAmmo][0],
HouseInfo[iIndex][hWepAmmo][1],
HouseInfo[iIndex][hWepAmmo][2],
HouseInfo[iIndex][hWepAmmo][3],
HouseInfo[iIndex][hWepAmmo][4],
HouseInfo[iIndex][hMeth],
HouseInfo[iIndex][hBatteryAcid],
HouseInfo[iIndex][hCrackStuff],
HouseInfo[iIndex][hSeeds],
HouseInfo[iIndex][hSyringes]
);

if(HouseInfo[iIndex][hOwned]) {
SendClientMessageEx(iIndex, COLOR_WHITE,"Available Commands: /enter, /doorbell, /rentroom");
if(HouseInfo[iIndex][hRentable] == 0) format(szFileStr, sizeof(szFileStr), "This house is owned by\n%s\nLevel: %d\nID: %d",HouseInfo[iIndex][hOwner],HouseInfo[iIndex][hLevel],iIndex);
else format(szFileStr, sizeof(szFileStr), "This house is owned by\n%s\nRent: $%d\nLevel: %d\nID: %d\nType /rentroom to rent a room",HouseInfo[iIndex][hOwner],HouseInfo[iIndex][hRentFee],HouseInfo[iIndex][hLevel],iIndex);

DestroyDynamicPickup(HouseInfo[iIndex][hPickupID]);
HouseInfo[iIndex][hPickupID] = CreateDynamicCP(HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], 2, -1, -1,-1, 10);
}
else {
SendClientMessageEx(iIndex, COLOR_WHITE,"Available Commands: /enter, /doorbell, /rentroom");
HouseInfo[iIndex][hMapIcon] = CreateDynamicMapIcon(HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], 31, 1, -1, -1, -1, 100.0);
format(szFileStr, sizeof(szFileStr), "This house is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nID: %d\nTo buy this house type /buyhouse",HouseInfo[iIndex][hDescription],HouseInfo[iIndex][hValue],HouseInfo[iIndex][hLevel],iIndex);
}

DestroyDynamicPickup(HouseInfo[iIndex][hPickupID]);
HouseInfo[iIndex][hPickupID] = CreateDynamicCP(HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], 2, -1, -1,-1, 10);
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_ORANGE, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
++iIndex;
}
return fclose(iFileHandle);
}
__________________
Ponga is offline   Reply With Quote
Old 08/08/2019, 12:30 PM   #13
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,120
Reputation: 68
Default Re: TEXTDRAWS AND MAPPINGS

well it has such a big arrays, I don't think that problem must be in there anymore xd, try to comment LoadHouse function and start without that function, lets see what we'll get.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/08/2019, 12:32 PM   #14
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 77
Reputation: 9
Default Re: TEXTDRAWS AND MAPPINGS

Do you want me to change the loadhouses to loadhouse?
__________________
Ponga is offline   Reply With Quote
Old 08/08/2019, 12:34 PM   #15
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,120
Reputation: 68
Default Re: TEXTDRAWS AND MAPPINGS

no no, just comment it with /* */ and try to start server.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/08/2019, 12:35 PM   #16
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 77
Reputation: 9
Default Re: TEXTDRAWS AND MAPPINGS

I got you, compiling
__________________
Ponga is offline   Reply With Quote
Old 08/08/2019, 12:46 PM   #17
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 77
Reputation: 9
Default Re: TEXTDRAWS AND MAPPINGS

It's worked maps and textdraws is now and this shit showing on samp-server.exe
__________________
Ponga is offline   Reply With Quote
Old 08/08/2019, 12:55 PM   #18
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,120
Reputation: 68
Default Re: TEXTDRAWS AND MAPPINGS

looks like problem wasn't here.
you must look in ServerHeartbeatTwo and in OnPlayerStateChange now.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/08/2019, 01:05 PM   #19
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 77
Reputation: 9
Default Re: TEXTDRAWS AND MAPPINGS

Everything is fine now but what should i do at loadhouses
__________________
Ponga is offline   Reply With Quote
Old 08/08/2019, 01:11 PM   #20
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,120
Reputation: 68
Default Re: TEXTDRAWS AND MAPPINGS

how is it fine when you get these errors?
if you're building a new mode, better doing it with mysql.

code in LoadHouse is correct, except CreateDynamic3DTextLabel, remove dots from testlos and streamdistance, it's not C++
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map] Few of my mappings, you`re welcome. iRXTS Maps 64 17/01/2017 10:12 PM
[Map] My mappings Yur Maps 3 20/07/2014 07:17 PM
Mappings not loading FlawPaw Server Support 5 16/11/2013 11:04 AM
Mappings RyanDam Server Support 1 15/02/2013 05:04 PM


All times are GMT. The time now is 08:19 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.