Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: m1k3 on Mar 13, 2016, 02:50 PM

Title: /pmirc <User>
Post by: m1k3 on Mar 13, 2016, 02:50 PM
else if ( cmd == "pmirc" )
{
if (status[ player.ID ].IsReg == false) MessagePlayer(RED+"** [KM-Error]: >> "+ORANGE+"You Need To Registered First!",player);
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer(RED+"** [KM-Error]: >> "+ORANGE+"You Need To Logged-In First!",player);
else if ( !text ) MessagePlayer(ORANGE+"Usage: /" + cmd + " [User] [Message]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer(ORANGE+"Usage: /" + cmd + " [User] [Message]", player );
else {
local user = GetTok( text, " ", 1 );
local msg = GetTok( text, " ", 2, NumTok( text, " " ));
EchoNotice( user, ICOL_LBLUE+"> Private Message from "+ICOL_RED+""+player.Name+""+ICOL_LBLUE+": "+msg );
MessagePlayer( WHITE+"> Sent Message to "+RED+""+user+""+WHITE+": "+msg, player );
}
}

This command was made by me! Because a friend asked me if i could do one!
Title: Re: /pmirc <User>
Post by: EK.IceFlake on Mar 13, 2016, 02:57 PM
Error: the index status does not exist
Error: the index EchoNotice does not exist
Error: the index ICOL_LBLUE does not exist
Error: the index ICOL_RED does not exist
Error: the index WHITE does not exist
Error: the index RED does not exist
@ElectriX can u plz help me with these errors? i m sure i just copy paste it exact
Title: Re: /pmirc <User>
Post by: Xmair on Mar 13, 2016, 03:17 PM
@NECrystalBlue bro help me pls i founded error aslo yes cant fix bro it @ElectriX error look at pleaze
The index, 'status' , 'Numtok' , 'GetTok' , 'EchoNotice' , 'RED' , 'ORANGE' , 'WHITE' , 'ICOL_LBLUE' and 'ICOL_RED' does not exist. Also, you didn't checked that if the user is there or not.
Title: Re: /pmirc <User>
Post by: Cena on Mar 13, 2016, 03:58 PM
I Told @ElectriX Not To Copy And Past Lel.
else if ( cmd == "pmirc" )
{
else if ( !text ) MessagePlayer("Usage: /" + cmd + " [User] [Message]", player );
else {
local user = GetTok( text, " ", 1 );
local msg = GetTok( text, " ", 2, NumTok( text, " " ));
EchoNotice( user,"> Private Message from "+player.Name+": "+msg );
MessagePlayer( > Sent Message to """+user+""": "+msg, player );
}
}
try this and idk what to replace EchoMessage with (EchoMessage is like MessagePlayer it will show to only specified player)
Title: Re: /pmirc <User>
Post by: Xmair on Mar 13, 2016, 04:24 PM
@Cena expression expected.
Title: Re: /pmirc <User>
Post by: Cena on Mar 14, 2016, 07:55 AM
Quote from: Xmair on Mar 13, 2016, 04:24 PM@Cena expression expected.
Because of this MessagePlayer( > Sent Message to """+user+""": "+msg, player ); Replace it with MessagePlayer(" > Sent Message to "+user+": "+msg, player ); And What U replace EchoMessage with?
Title: Re: /pmirc <User>
Post by: Xmair on Mar 14, 2016, 09:27 AM
@Cena expression expected. He put an 'else if' in the first place after if ( cmd == "pmirc") {
Title: Re: /pmirc <User>
Post by: EK.IceFlake on Mar 14, 2016, 12:11 PM
You know that we haven't actually tested it and just pointing out bugs from our first glance, right? Also, EchoNotice is the main function and core of this script... AND IT IS THE ONLY FREAKING FUNCTION YOU DONT HAVE!
Title: Re: /pmirc <User>
Post by: Coolkid on Mar 14, 2016, 07:57 PM
me and electrix are working together on a script and this command works prefectly and they r no error in this if u want to test my server is on u can test it i have added this command in it
Title: Re: /pmirc <User>
Post by: Coolkid on Mar 14, 2016, 07:59 PM
Quote from: NE.CrystalBlue on Mar 13, 2016, 02:57 PMError: the index status does not exist
Error: the index EchoNotice does not exist
Error: the index ICOL_LBLUE does not exist
Error: the index ICOL_RED does not exist
Error: the index WHITE does not exist
Error: the index RED does not exist
@ElectriX can u plz help me with these errors? i m sure i just copy paste it exact
u have to change the colors it will not work write rgb code intead of colors we r using color names because we have specified it on top of script rest command is fine
join my channel #boss i will pm u
Title: Re: /pmirc <User>
Post by: m1k3 on Mar 18, 2016, 07:35 PM
Errors Fixed:

else if ( cmd == "pmirc" )
{
if ( !text ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else {
local user = GetTok( text, " ", 1 );
local msg = GetTok( text, " ", 2, NumTok( text, " " ));
EchoNotice( user, "> Private Message from "+player.Name+": "+msg );
MessagePlayer( "[#79EF06]> Sent Message to [#FF0000]"+user+"[#79EF06]: "+msg, player );
}
}

Any other error reply!
Title: Re: /pmirc <User>
Post by: Coolkid on Mar 18, 2016, 08:56 PM
Quote from: ElectriX on Mar 18, 2016, 07:35 PMErrors Fixed:

else if ( cmd == "pmirc" )
{
if ( !text ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else {
local user = GetTok( text, " ", 1 );
local msg = GetTok( text, " ", 2, NumTok( text, " " ));
EchoNotice( user, "> Private Message from "+player.Name+": "+msg );
MessagePlayer( "[#79EF06]> Sent Message to [#FF0000]"+user+"[#79EF06]: "+msg, player );
}
}

Any other error reply!
Good work
Title: Re: /pmirc <User>
Post by: m1k3 on Mar 19, 2016, 10:24 PM
Thnx!
Title: Re: /pmirc <User>
Post by: Coolkid on Mar 19, 2016, 10:58 PM
Quote from: ElectriX on Mar 19, 2016, 10:24 PMThnx!
Welcome