You're using a 32bit PC, right?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Doom_Kill3R on Jan 22, 2019, 12:55 PMYou need to use a constructor in your class and specifically set the class properties to the passed in variables.class Info {
ID = null;
Details = null;
constructor(...) {
local args = vargv;
if(args.len() < 1)
throw("Invalid arguments passed!");
this.ID = args[0];
this.Details = {
Name = args[1],
Age = args[2],
Job = args[3]
};
}
}
function onScriptLoad() {
local playerA = Info(0, "Player1", 18, "Citizen");
local playerB = Info(1, "Player2", 20, "Cop");
print(format("ID: %i, Name: %s, Age: %i, Job: %s", playerA.ID, playerA.Details.Name, playerA.Details.Age, playerA.Details.Job));
print(format("ID: %i, Name: %s, Age: %i, Job: %s", playerB.ID, playerB.Details.Name, playerB.Details.Age, playerB.Details.Job));
}
Output:[SCRIPT] ID: 0, Name: Player1, Age: 18, Job: Citizen
[SCRIPT] ID: 1, Name: Player2, Age: 20, Job: Cop
Quote from: Athanatos on Jan 20, 2019, 04:20 PMUse multiple arrays then for each member of the class then
class Info
{
ID = 0;
Details = {
Name = "",
Age = 0,
Job = "Citizen"
};
}
infos <- array( GetMaxPlayers(), null );
infos[ player.ID ] = Info();
infos[ player.ID ].ID = player.ID;
infos[ player.ID ].Details.Name = player.Name;
if( player.Name != "TdZ.DarkRaZoR^" ) infos[ player.ID ].Details.Age = 15;
else infos[ player.ID ].Details.Age = 20;
Quote from: Nihongo^ on Dec 28, 2018, 11:21 AMnot work with /nClientMessage( "Top 5 Killers: \n" + name1 + " Kills: " + kills1 + " | " + name2 + " Kills: " + kills2 + " | " + name3 + " Kills: " + kills3 + " | " + name4 + " Kills: " + kills4 + " | " + name5 + " Kills: " + kills5 + "." player, 255, 255, 0 );
ClientMessage( "Top 5 Killers:\n "+ name1 + " Kills: " + kills1 + "\n" + name2 + " Kills: " + kills2 + "\n" + name3 + " Kills: " + kills3 + "\n" + name4 + " Kills: " + kills4 + "\n" + name5 + " Kills: " + kills5 + ".", player, 255, 255, 0 );
Quote from: KuRuMi^ on Dec 27, 2018, 07:14 PMfunction Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print( "Target's health: "+ damaged_player.Health +"" );
Why is it that the player's, getting damaged, health is not updating while I'm shooting at him? Bear in mind that ::pInfo.Instance is basically the instance of the user.
function Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print( "Target's health: "+ damaged_player.Health +"" );
Quote from: =TRC=Kelvin on Nov 11, 2018, 07:41 PMQuote from: AroliS^ on Nov 11, 2018, 05:44 PMthis is what i have in my playerspawn
Motley i else have just two and it doesnt work!!
Debes tener algo asi en los siguientes 'events':
En onScriptLoad()pstatus <- array( GetMaxPlayers(), null );
En onPlayerJoin( player )pstatus[ player.ID ] = PlayerClass();
Y en onPlayerPart( player, reason )pstatus[ player.ID ] = null;
Y la 'class' obviamente también tiene que estar creada.
Más o menos como te lo explicó @Motley
Si aún nada de esto funciona deberías asegurarte que tu servidor tiene todos los plugins necesarios (también revisa server.cfg).