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
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++;
}
https://ibb.co/fFUPLU
like this bro
and can i ad flags for Haitians and cubans? cubans can stole haitian flag
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.
how bro?
i never used Cilent side can u help me some thing?
xD so who's here can help me :P
Mahmoud come to my server
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
nah bro its bad.
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
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
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.
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
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?
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;
}
}
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 + "]" );
}
}
showing errror
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();
}
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
(https://i.imgur.com/d2CWeRA.jpg)
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)
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
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
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.
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 );
}
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
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
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.
OKKKKKKKK
https://ibb.co/fwchC9
Quote from: =RK=MarineForce on Sep 11, 2018, 02:10 PMOKKKKKKKK
https://ibb.co/fwchC9
now give the code it has error and mention the time number that has error.
hmm i don't understand.
Quote from: =RK=MarineForce on Sep 11, 2018, 02:41 PMhmm i don't understand.
give me the line which has the error
hmm i don't know that line server is showing error which i gave u in screen short.
line 3 i think.
but ur script look like there is no bug but how its showing error?
for f sakes, use switch(player.Skin) where possible.
lel :-[
dump* no work thanks for ur help
Quote from: =RK=MarineForce on Sep 14, 2018, 10:34 AMdump* no work thanks for ur help
no work? You are not providing complete details of the error. It's your mistake
i removed some thing from OnPlayerKill . its works how?
this is works for me
function onPlayerKill( killer,player, reason, bodypart )
{
for(local i=0; i< =GetMaxPlayers();i++)
{
local plr = FindPlayer(i);
if(plr) SendDataToClient(plr, 1, "1");
}
for(local i= 0; i< =GetMaxPlayers();i++)
{
local plr = FindPlayer(i);
if(plr) SendDataToClient(plr, 2, "1");
}
}
function onPlayerKill( killer,player, reason, bodypart )
{
if ( (player.Skin == 85) || (player.Skin ==86 ) )
{
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");
}
}
if ( (player.Skin == 83) || (player.Skin ==84 ) )
{
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");
}
}
if ( Stats[ player.ID ].AntiSP )
{
killer.Health = 0;
Message( "[#00de00]Information: [#fbf3f3]" + killer.Name + " Have Been Killed. Reason: Spawn-Kill." );
}
else
{
player.PlaySound( 50015);
stats[ player.ID ].kills++;
inccash( player );
stats[ killer.ID ].deaths++;
deccash( killer );
KillingSpree.IsSpree( killer, player, reason );
Message( "[#1FFFF9]>> " + killer.Name + "[#FFF11B] killed [#FF0000] " + player.Name + "[#FFF11B] Weapon: [[#6BFF46]" + GetWeaponName( reason ) + "[#FFF11B]] [#FFF11B]Ping:[#1FFFF9][" + killer.Ping + "]" );
}
}
Fixed