Cubans vs Haitians . Score

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

Previous topic - Next topic

=RK=MarineForce

Hello Guyz How can i add Cubans and Haitian score.

i made this

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 );
if ( (player.Skin == 85) ||  ( player.Skin ==86 ) ) Message(" [#00cc00] [Haitian Team ] Got a Score by Killing Cuban Player +1 );
else{
Message( "[#1FFFF9]>> " + killer.Name + "[#FFF11B] killed [#FF0000] " + player.Name + "[#FFF11B] Weapon: [[#6BFF46]" + GetWeaponName( reason ) + "[#FFF11B]] [#FFF11B]Ping:[#1FFFF9][" + killer.Ping + "]" );
}
}
it look like ctf.

RED Score
Blue Score:

how can i add this ?

i think Cilent Side. but i don't know much about Cilent Side.

QuoteWhere Are 0.6 Plugins

Mahmoud Tornado

Quote from: =RK=MarineForce on Sep 08, 2018, 08:29 AMfunction onPlayerKill( killer,player, reason, bodypart )
{
if ( (player.Skin == 83) ||  ( player.Skin ==84 ) ) Message(" [#CCFF00] [Cuban Team] Got a Score by Killing Haitian Player +1 );
if ( (player.Skin == 85) ||  ( player.Skin ==86 ) ) Message(" [#00cc00] [Haitian Team ] Got a Score by Killing Cuban Player +1 );
else{
Message( "[#1FFFF9]>> " + killer.Name + "[#FFF11B] killed [#FF0000] " + player.Name + "[#FFF11B] Weapon: [[#6BFF46]" + GetWeaponName( reason ) + "[#FFF11B]] [#FFF11B]Ping:[#1FFFF9][" + killer.Ping + "]" );
}
}

Here no score saving you just made a msg, so you can add this,
Cuban_Team_Score <- 0;
Haitian_Team_Score <- 0;

Then make it count in every kill like that.
if ( (player.Skin == 83) ||  ( player.Skin ==84 ) )
{
Message(" [#CCFF00] [Cuban Team] Got a Score by Killing Haitian Player +1" );
Cuban_Team_Score++;
}
if ( (player.Skin == 85) ||  ( player.Skin ==86 ) )
{
Message(" [#00cc00] [Haitian Team ] Got a Score by Killing Cuban Player +1" );
Haitian_Team_Score++;
}

=RK=MarineForce

https://ibb.co/fFUPLU

like this bro

and can i ad flags for Haitians and cubans? cubans can stole haitian flag

Mahmoud Tornado

Quote from: =RK=MarineForce on Sep 08, 2018, 09:16 PMhttps://ibb.co/fFUPLU

like this bro

and can i ad flags for Haitians and cubans? cubans can stole haitian flag
This is a client side, you must make a loop with main side and client side, i just gave you the idea of the score.

=RK=MarineForce

how bro?

 i never used Cilent side can u help me some thing?


=RK=MarineForce

xD so who's here can help me :P

Mahmoud come to my server

umar4911

Quote from: =RK=MarineForce on Sep 08, 2018, 10:47 PMhow bro?

 i never used Cilent side can u help me some thing?
Use announcments then
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

=RK=MarineForce


=RK=MarineForce

#9
Cuban_Team_Score <- 0;
Haitian_Team_Score <- 0;

Labul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "Score Cuban " + Cuban_Team_Score + " Haitian " + Haitian_Team_Score + " "
    Labul.FontSize = 25;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
}

added this

not updaing score

@Umar bro i need help :P

umar4911

Quote from: =RK=MarineForce on Sep 09, 2018, 12:59 PMCuban_Team_Score <- 0;
Haitian_Team_Score <- 0;

Labul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "Score Cuban " + Cuban_Team_Score + " Haitian " + Haitian_Team_Score + " "
    Labul.FontSize = 25;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
}

added this

not updaing score

@Umar bro i need help :P
Will give you as soon as I reach PC
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

umar4911

Sorry for being late but here's the script.

I added 2 new commands too. AddCubanScore and AddHaitianScore



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



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 + "]" );
}
}


onPlayerCommand(player, cmd, text)
{
        cmd = cmd.tolower();
        text = text.tolower();
else if(cmd == "addcubanscore")
{
if(!text || !IsNum(text)) MessagePlayer("Error - Wrong Syntax. Use /"+cmd+" <score>", player);
else
{
for(local i=0;i<=GetMaxPlayers();i++)
{
local plr = FindPlayer(i);
if(plr) SendDataToClient(plr, 1, text);
}
}

}


else if(cmd == "addhaitianscore")
{
if(!text || !IsNum(text)) MessagePlayer("Error - Wrong Syntax. Use /"+cmd+" <score>", player);
else
{
for(local i=0;i<=GetMaxPlayers();i++)
{
local plr = FindPlayer(i);
if(plr) SendDataToClient(plr, 2, text);
}
}

}
}



////////Client Side//////////////

function Server::ServerData(stream)
{
local StreamReadInt = stream.ReadInt(),
StreamReadString = stream.ReadString();
switch (StreamReadInt.tointeger())
{
case 1:
AddCubanScore(StreamReadString);
break;
case 2:
AddHaitianScore(StreamReadString);
break;
default: break;
}
}


Cuban_Label <- null;
Haitian_Label <- null;
Cuban_Team_Score <- 0;
Haitian_Team_Score <- 0;
_screen <- GUI.GetScreenSize();



function AddCubanScore(score)
{
if(Cuban_Label == null)
{
Cuban_Label <- GUILabel(VectorScreen(_screen.X * 0.4, _screen.Y * 0.1), Colour(235,0,0), "Cuban Score: "+Cuban_Team_Score);
Cuban_Label.FontFlags = GUI_FFLAG_BOLD;
Cuban_Label.FontSize = _screen.X * 0.02;
Haitian_Label <- GUILabel(VectorScreen(_screen.X * 0.4, _screen.Y * 0.15), Colour(235,0,0), "Haitian Score: "+Haitian_Team_Score);
Haitian_Label.FontFlags = GUI_FFLAG_BOLD;
Haitian_Label.FontSize = _screen.X * 0.02;
}

Cuban_Team_Score <- Cuban_Team_Score + score.tointeger();
Cuban_Label.Text = "Cuban Score: "+Cuban_Team_Score;
}

function AddHaitianScore(score)
{
if(Haitian_Label == null)
{
Cuban_Label <- GUILabel(VectorScreen(_screen.X * 0.4, _screen.Y * 0.1), Colour(235,0,0), "Cuban Score: "+Cuban_Team_Score);
Cuban_Label.FontFlags = GUI_FFLAG_BOLD;
Cuban_Label.FontSize = _screen.X * 0.02;
Haitian_Label <- GUILabel(VectorScreen(_screen.X * 0.4, _screen.Y * 0.15), Colour(235,0,0), "Haitian Score: "+Haitian_Team_Score);
Haitian_Label.FontFlags = GUI_FFLAG_BOLD;
Haitian_Label.FontSize = _screen.X * 0.02;
}


Haitian_Team_Score <- Haitian_Team_Score + score.tointeger();
Haitian_Label.Text = "Haitian Score: "+Haitian_Team_Score;
}
P.S: It's untested.
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

=RK=MarineForce

wtf bro i m tried 2 hours >:( >:(


function onPlayerChat( player, 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();

if( IsMuted[ player.ID] ){

MessagePlayer(">> You are muted.",player);

}
else{
if ( (player.Skin == 83) ||  ( player.Skin ==84 ) )
{
Message("[#CCFF00][Cuban Team] " + player.Name + ": " + text + " " );
}
if ( (player.Skin == 85) ||  ( player.Skin ==86 ) )
{
Message("[#00cc00][Haitian Team] " + player.Name + ": " + text + " " );
}
if ( (player.Skin == 215) ||  ( player.Skin ==160 ) )
{
Message("[#FFFFFF][Spectate] " + player.Name + ": " + text + " " );
}
}
return 1;


}

whats wrong in this >:( >:(
FUCK FUCK FUCK whats wrong in this function i  m tried >:( 2 hours 

=RK=MarineForce

#13

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 + "]" );
 }
}
 

Column = 3 line = 373

any way u scripted best.

Announce( "~q~ HT "+ Haitian_Team_Score +"  ~y~ CT "+ Cuban_Team_Score +" ", player, 5 );
is this good?

umar4911

try this for chat
function onPlayerChat( player, 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();

if( IsMuted[ player.ID] ){

MessagePlayer(">> You are muted.",player);

}
else
{
if ( (player.Skin == 83) ||  ( player.Skin ==84 ) )
{
Message("[#CCFF00][Cuban Team] "+player.Name+": "+message);
}
if ( (player.Skin == 85) ||  ( player.Skin ==86 ) )
{
Message("[#00cc00][Haitian Team] " + player.Name + ": " + message);
}
if ( (player.Skin == 215) ||  ( player.Skin ==160 ) )
{
Message("[#FFFFFF][Spectate] " + player.Name + ": " + message);
}
return 0;
}

}
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter