Log in

View Full Version : 3 questions



Lobzz1k
09-22-2012, 09:47 AM
1)
Please, give me example of item save function.
I can make saving of Caps or Stimpacks only.
I dont know how to get list of all inventory and its ammount...

2)
How to make Male gender in game?

SetActorBaseSex(ID, male);
return error:

error 017: undefined symbol "male"; did you mean "false"?

3)
Where i can find index names for

SetActorBaseValue(ID, index, Float:value);
SetActorValue(ID, index, Float:value);

P.S: Thx for all.

Smoria
09-22-2012, 10:49 AM
Saving items of players
Other (https://www.vaultmp.com/showthread.php?1416-Gary-4)

Lobzz1k
09-22-2012, 05:59 PM
Its for C++, I am use PAWN!
(I am New one in programing...)

Smoria
09-22-2012, 06:31 PM
1. This is just example. Write your own code for pawn.

2.
SetActorBaseSex - changes sex. True: female

NeoPhoenix
09-23-2012, 12:13 PM
1. This is just example. Write your own code for pawn.
not implemented for pawn yet

Lobzz1k
09-25-2012, 01:40 PM
I am do that:


public OnSpawn(ID)
{


if (IsPlayer(ID))
{
new sendmsg {MAX_MESSAGE_LENGTH};
new pname[255];

SetActorBaseSex(ID, false);
GetName(ID, pname);
strformat(sendmsg, sizeof(sendmsg), true, "Welcome, %s!", pname);

//adding first time inventory...
AddItem(ID, 0x000080A, 1, 45.0, true);
AddItem(ID, 0x0034122, 1, 54.0, true);
AddItem(ID, 0x00207f7, 59, 100.0, true);
AddItem(ID, 0x0015169, 6, 100.0, true);
AddItem(ID, 0x000000F, 89, 100.0, true);
//equip it now
EquipItem(ID, 0x000080A, false, false);
EquipItem(ID, 0x0034122, false, false);

ChatMessage(ID, sendmsg);
}
}

but I am still spawn like female, also I tried to replace ID by 0...

foxtacles
09-25-2012, 05:44 PM
Thanks, I fixed it. Until the next version, you can change the sex with a delay like 200ms (timer) triggered in OnSpawn, or use it in some other callback.

https://www.vaultmp.com/showthread.php?1426-Fix-age-sex-not-applying-in-some

Lobzz1k
09-26-2012, 09:23 PM
1)Thx, but where i can find indexes for PlayerValue functions?

2)I have few suggestions:
RunConsoleCommand function
and
EnableConsole function can be present in next ver of VaultMP?
Its will be great...

foxtacles
09-26-2012, 10:08 PM
Here are the indices (will be included some time in the scripting headers): https://github.com/Foxtacles/vaultmp/blob/master/source/API.h#L262

Why do you want to run console commands? If there is any specific feature accessible with the console, I can map it to vaultmp if it is suitable. Instead of running console functions, you will be able to use native vaultmp scripting functions. Just name what you need.

The console will be disabled by default in a future version and can be re-enabled per player in a script.

Lobzz1k
09-27-2012, 05:50 AM
With RunConsoleCommand i can do that:
OnPlayerSpawn(ID)
{
RunConsoleCommand(ID, "ShowRaceMenu");
}
for example...

or
RunConsoleCommand(ID, "tgm");

foxtacles
09-27-2012, 05:35 PM
These menus are not synced.