Hi all,
since i used engine->PEntityOfEntIndex() in the code my plugin crashs
(PS : the commands before using this function
http://forums.alliedmods.net/showthread.php?t=37220 )
New code :
Code:
KeyValues *kv = new KeyValues( "menu" );
kv->SetString( "title", mess);
kv->SetString( "msg", "" );
kv->SetColor( "color", Color( ss_hudmsg_blue.GetInt(), ss_hudmsg_green.GetInt(), ss_hudmsg_blue.GetInt(), ss_hudmsg_alpha.GetInt()));
kv->SetInt( "level", 2);
kv->SetInt( "time", ss_hudmsg_time.GetInt());
for (int i=1;i<=i_MaxPlayers;i++){
IPlayerInfo *playerinfo=playerinfomanager->GetPlayerInfo(engine->PEntityOfEntIndex(i));
if (playerinfo->IsConnected()){
helpers->CreateMessage(engine->PEntityOfEntIndex(i), DIALOG_MSG, kv, this );
}
}
kv->deleteThis();
Code:
helpers->CreateMessage(engine->PEntityOfEntIndex(i), DIALOG_MSG, kv, this );
instead of
Code:
edict_t * player=(PlayersList+i);
helpers->CreateMessage(player, DIALOG_MSG, kv, this );
I want to use the least of edict_t as i can because Manip said me to do not use them
Hmm the code looks very wonderfull now... but it s crashing lol
Any idea?