Skip to content
User Avatar
#789
Auto-translated
GetPlayerRecource (1, 6, >=10000)
– Why can you write it like that?
GetPlayerResource (1, 6) >=10000
SetPlayerResource (6, -10000, 5, 10);
Sixth player, minus ten thousand ID? o_O
Check the Manuals and see the correct way to write the functions.
You can also browse through the scripts of other maps. To write scripts, you need to at least look at their basics ;)
Here is the basics:

number GetPlayerResource( nPlayerID, nResID )

Returns the current amount of resource nResID for player nPlayerID. Resource IDs are listed in /scripts/advmap-startup.lua and are as follows:
WOOD = 0
ORE = 1
MERCURY = 2
CRYSTAL = 3
SULFUR = 4
GEM = 5
GOLD = 6

void SetPlayerResource( nPlayerID, nResID, nCount )

Sets the current amount of resource nResID to nCount for player nPlayerID. Based on this function, a higher-level primitive is implemented in the /scripts/advmap-startup.lua file – void SetPlayerStartResource( nPlayerID, nResID, nCount ), which distributes starting resources to the player depending on the difficulty level.



Added 5 minutes ago
Warrior777
I AM COMPLETELY CONFUSED ABOUT WHAT TO DO???:confused: :confused: :confused: :smile33: :smile33: :smile33:
If you are completely stuck, send the map to my private messages. I will fix the script.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...