Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Gito Baloch on Apr 12, 2020, 09:41 AM

Title: [Solved] Show msg to admins.
Post by: Gito Baloch on Apr 12, 2020, 09:41 AM
Hy Scripters.

I want to know that..

this msg Message( "[#a20100]Admin "+player.Name+" set " + plr.Name + "  " + GetWeaponName( GetWeaponID( wep ) ) +". Ammo: " + ammo + ".");
shows to admins only not to players how i do that?
 :-\
Title: Re: Show msg to admins.
Post by: KX on Apr 12, 2020, 10:13 AM
Create a function with the admin message name or any name you want then Run a loop and check if the player level is equal to the admin level or greater than that.
if you want a readymade code then forget it at least from me but if you tried and got errors you are good to post here
Title: Re: Show msg to admins.
Post by: Gito Baloch on Apr 12, 2020, 01:01 PM
local admin = GetPlayer(stats[player.ID].Level < 3)
MessagePlayer("Player : "+player.Name+" has reported "+plr.Name+" for : "+reason+"", admin);

hey i did this still didn't worked.
Title: Re: Show msg to admins.
Post by: umar4911 on Apr 12, 2020, 04:11 PM
Quote from: Gitobaloch on Apr 12, 2020, 01:01 PMlocal admin = GetPlayer(stats[player.ID].Level < 3)
MessagePlayer("Player : "+player.Name+" has reported "+plr.Name+" for : "+reason+"", admin);

hey i did this still didn't worked.
untested
local admin;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
admin = FindPlayer( i );
if ( ( admin) && ( stats[ admin.ID ].Level >= 5 ) )
{
MessagePlayer("Player : "+player.Name+" has reported "+plr.Name+" for : "+reason+"", admin);
}
Title: Re: Show msg to admins.
Post by: Gito Baloch on Apr 12, 2020, 04:29 PM
Quote from: umar4911 on Apr 12, 2020, 04:11 PM
Quote from: Gitobaloch on Apr 12, 2020, 01:01 PMlocal admin = GetPlayer(stats[player.ID].Level < 3)
MessagePlayer("Player : "+player.Name+" has reported "+plr.Name+" for : "+reason+"", admin);

hey i did this still didn't worked.
untested
local admin;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
admin = FindPlayer( i );
if ( ( admin) && ( stats[ admin.ID ].Level >= 5 ) )
{
MessagePlayer("Player : "+player.Name+" has reported "+plr.Name+" for : "+reason+"", admin);
}
It was untested, but it worked. <3 thanks umar great personality. solved.