Cubans vs Haitians . Score

Started by =RK=MarineForce, Sep 08, 2018, 08:29 AM

Previous topic - Next topic

umar4911

this one for the score system
function onPlayerKill( killer,player, reason, bodypart )
{
 if ( (player.Skin == 83) ||  ( player.Skin ==84 ) )
 {
  Message(" [#CCFF00] [Cuban Team] Got a Score by Killing Haitian Player +1 );
  for(local i=0;i<=GetMaxPlayers();i++)
  {
   local plr = FindPlayer(i);
   if(plr) SendDataToClient(plr, 1, "1");
  }
 }
 else if ( (player.Skin == 85) ||  ( player.Skin ==86 ) )
 {
  Message(" [#00cc00] [Haitian Team] Got a Score by Killing Cuban Player +1 );
  for(local i=0;i<=GetMaxPlayers();i++)
  {
   local plr = FindPlayer(i);
   if(plr) SendDataToClient(plr, 2, "1");
  }
 }
 else
 {
  Message( "[#1FFFF9]>> " + killer.Name + "[#FFF11B] killed [#FF0000] " + player.Name + "[#FFF11B] Weapon: [[#6BFF46]" + GetWeaponName( reason ) + "[#FFF11B]] [#FFF11B]Ping:[#1FFFF9][" + killer.Ping + "]" );
 }
}
 
I am gamer, programmer and hacker. Try to find me!
xD

=RK=MarineForce

Try to UnderStand ME!

umar4911

I am gamer, programmer and hacker. Try to find me!
xD

Mahmoud Tornado

PlayerChat
function onPlayerChat( player, message )
 {
if( IsMuted[ player.ID] )
{
MessagePlayer(">> You are muted.",player);
return 0;
}
 else if ( (player.Skin == 83) ||  ( player.Skin ==84 ) )
 {
  Message("[#CCFF00][Cuban Team] "+player.Name+": "+message);
 }
 else if ( (player.Skin == 85) ||  ( player.Skin ==86 ) )
 {
  Message("[#00cc00][Haitian Team] " + player.Name + ": "+message);
 }
 else if ( (player.Skin == 215) ||  ( player.Skin ==160 ) )
 {
  Message("[#FFFFFF][Spectate] " + player.Name + ": "+message);
 }
local MUTE_DIVIDE = 1000;
       if ( ( time() - antiSpamTime[ player.ID ] ) <= LIMT_REP_TIME ) {
 antiSpamWarnings[ player.ID ]++;
 if ( antiSpamWarnings[ player.ID ] >= LIMIT_REP_SPAM ) {
  if( !IsMuted[ player.ID ] ){
    IsMuted[ player.ID ] = true;
    Message(format(">> Auto-Muted: %s Reason: Spamming the Chat. Duration[ %d seconds ]",player.Name,MUTE_TIME/MUTE_DIVIDE) );
    NewTimer("autounmute",MUTE_TIME.tointeger(),1,player.ID);
  }
 }
} else {
 antiSpamWarnings[ player.ID ] = 0;
}
antiSpamTime[ player.ID ] = time();
}

MEGAMIND

#19
hello there first of all nice work umar, secondly marine force if u implement the system correctly it works perfect (PS Umar there were minor bugs even a kid can find it :D). Tested on Blank server works perfect!
ok
so i have a slight issue here too

here my code of snippet ive been using for other purpose
function SendDataToClient( player, integer, string )
{
 
 if ( FindPlayer( player ) )
 {

 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream( FindPlayer( player ) );
 }

}

and heres urs

function SendDataToClient(player, integer, string)
{
 Stream.StartWrite();
 Stream.WriteInt(integer);
 if (string != null) Stream.WriteString(string);
 Stream.SendStream(player);
}

the difference in both is

Stream.SendStream( FindPlayer( player ) );
  Stream.SendStream(player);

and

if ( FindPlayer( player ) )
 {

}

so i have tried implementing it but it doesnt seem to work just gives me errors out on console in these code saying invalid argument FindPlayer something like that so what would be the alternative to that code ty.

this is what comes up



DizzasTeR

Maybe because the 'player' is already a player instance and not a "player name" or a player id so you don't even need FindPlayer(player)

MEGAMIND

#21
Quote from: Doom_Kill3R on Sep 11, 2018, 08:29 AMMaybe because the 'player' is already a player instance and not a "player name" or a player id so you don't even need FindPlayer(player)

thanks that worked out but i cannot see my gui labels on screen now , instead it shows aniks registeration screen

MEGAMIND

is there a method to do it like this?

function SendDataToClient( player, integer, string )
{
 if ( FindPlayer( player ) )
 {

 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream( FindPlayer( player ) );
  //Stream.SendStream(player);
 
 }
 else
 {
 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream(player);
 }

}


}
or can we use switch case if yes then how

umar4911

#23
Instead of using if(FindPlayer(player)) use if(player)
function SendDataToClient( player, integer, string )
{
 
 if (player )
 {

 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream( player );
 }

}

Btw the one I made also works perfectly.
I am gamer, programmer and hacker. Try to find me!
xD

MEGAMIND

Quote from: umar4911 on Sep 11, 2018, 09:47 AMInstead of using if(FindPlayer(player)) use if(player)
function SendDataToClient( player, integer, string )
{
 
 if (player )
 {

 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream( player );
 }

}

Btw the one I made also works perfectly.
i did that but now anik system wont work

!

Quote from: MEGAMIND on Sep 11, 2018, 09:18 AMis there a method to do it like this?

function SendDataToClient( player, integer, string )
{
 if ( FindPlayer( player ) )
 {

 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream( FindPlayer( player ) );
  //Stream.SendStream(player);
 
 }
 else
 {
 Stream.StartWrite( );
 Stream.WriteInt( integer );
 if ( string != null ) Stream.WriteString( string );
 Stream.SendStream(player);
 }

}


}
or can we use switch case if yes then how
Yes there is

function SendDataToClient( player, integer, string )
{
  if ( typeof( player )  != "Instance" ) player = FindPlayer( player );
  if ( !player ) return;
 
  Stream.StartWrite( );
  Stream.WriteInt( integer );
  if ( string != null ) Stream.WriteString( string );
  Stream.SendStream( player );
}

Discord: zeus#5155

=RK=MarineForce

Umar bro? the line of onpalyer kill

is showing me error. i added all things without cmds only

but The label its not showing me Score. if i added Cilent side but not showing in screen Haitian Score cuban score
Try to UnderStand ME!

=RK=MarineForce

ok leave it if its bug i will use annoucement @umar

how can i play sound for only team?

plr.PlaySound( 50001 )
player.PlaySound( 50002 )

now how i can make it for team only? and team chaT? there is function of team
Try to UnderStand ME!

umar4911

Quote from: =RK=MarineForce on Sep 11, 2018, 10:35 AMUmar bro? the line of onpalyer kill

is showing me error. i added all things without cmds only

but The label its not showing me Score. if i added Cilent side but not showing in screen Haitian Score cuban score
what is the ERROR!!!!!
Its better for you to send a screenshot of it.
I am gamer, programmer and hacker. Try to find me!
xD

=RK=MarineForce

Try to UnderStand ME!