Messages - FarisDon
1
Scripting and Server Management / Re: About command
« on February 21st, 2016, 12:01 PM »
Quote from Xmair on February 21st, 2016, 10:50 AM
Quote from [TBS]Destroyer on February 21st, 2016, 09:27 AM
Quote from Xmair on February 21st, 2016, 09:23 AM
@[TBS]Destroyer , this can be improved.
Code: [Select]
function onScriptLoad ( )
{
work <- array ( GetMaxPlayers ( ) , "" );
}

function onPlayerCommand ( i_player , command , arguments )
{
local player = i_player , cmd = command.tolower( ), text = arguments;
if ( cmd == "job" )
{
text = text.tolower( );
if ( !text ) MessagePlayer("/job [ Assault / Scout / AntiTank ]" , player);
else if ( text == "assault" )
{
if ( work [ player.ID ] != "assault" )
{
player.Disarm( );
player.SetWeapon( 17 , 40 );
player.SetWeapon( 12 , 7 );
player.SetWeapon( 121 , 250 );
work [ player.ID ] = "assault";
MessagePlayer( "[#00FFF7]You're an assault trooper now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You're already " + work [ player.ID ] + "!" , player);
}
else if ( text == "scout" )
{
if ( work [ player.ID ] != "scout" )
{
player.Disarm( );
player.SetWeapon( 17 , 40 );
player.SetWeapon( 12 , 7 );
player.SetWeapon( 28 , 25 );
work [ player.ID ] = "scout";
MessagePlayer("[#00FFF7]You're a scout trooper now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You're already " + work [ player.ID ] + "!" , player);
}
else if ( text == "antitank" )
{
if ( work [ player.ID ] != "antitank" )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
work [ player.ID ] = "antitank";
MessagePlayer("[#00FFF7]You are an anti tanker now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You are already " + work [ player.ID ] + "!" , player);
}
else MessagePlayer( "/job [ Assault / Scout / AntiTank ]" , player );
}
}

function onPlayerPart ( player , reason )
{
work [ player.ID ] = "";
}
Untested.
Sure, it could be, no doubt, but I really hate making the Cmds, for those ._. who just say I want, but the reason why I made this command, so like this cause, I guess he is too newbish to understand codes like that. my provided code could be more short like this
Code: [Select]
else if ( cmd== "assault")
{
if ( assaults[player.ID] != 1 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(121,250);
MessagePlayer("[#00FFF7]You Are A assault Man Now",player);
player.IsFrozen = false;
assaults[player.ID] = 1;
}
else ClientMessage("You have already selected the "Assault"",player,255,255,0);
}
else if ( cmd== "scount")
{
if ( scouts[player.ID] != 1  )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(28,25);
MessagePlayer("[#00FFF7]You Are A Sniper Man Now",player);
player.IsFrozen = false;
scouts[player.ID] = 1;
}
ClientMessage("You have already selected the Scout",player,255,255,0);
}
else if ( cmd== "antitank")
{
if ( antitanks[player.ID] != 1 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
MessagePlayer("[#00FFF7]You Are A AntiTanker Now",player);
antitanks[player.ID] = 1;
}
else ClientMessage("You have already selected the Anti-Tank",player,255,255,0);
}
but the reason why i didn't made it like yours, or it short to make his understanding better anyway, I seriously don't know how to explain; however, i didn't also seen him saying about job or anyway that's why i made it the way he provided the code.
P.S: - Well we can just say that everybody have their own algorithm.
The command you just made now will give you a error 'expression expected'. else ClientMessage("You have already selected the "Assault"",player,255,255,0);
Sorry, I didn't tested the code; however, I tested it right now, and worked fine! but maybe you have putted the code wrong, or simply change "Assault" to Assault that's it.
2
Scripting and Server Management / Re: About command
« on February 21st, 2016, 09:27 AM »
Quote from Xmair on February 21st, 2016, 09:23 AM
@[TBS]Destroyer , this can be improved.
Code: [Select]
function onScriptLoad ( )
{
work <- array ( GetMaxPlayers ( ) , "" );
}

function onPlayerCommand ( i_player , command , arguments )
{
local player = i_player , cmd = command.tolower( ), text = arguments;
if ( cmd == "job" )
{
text = text.tolower( );
if ( !text ) MessagePlayer("/job [ Assault / Scout / AntiTank ]" , player);
else if ( text == "assault" )
{
if ( work [ player.ID ] != "assault" )
{
player.Disarm( );
player.SetWeapon( 17 , 40 );
player.SetWeapon( 12 , 7 );
player.SetWeapon( 121 , 250 );
work [ player.ID ] = "assault";
MessagePlayer( "[#00FFF7]You're an assault trooper now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You're already " + work [ player.ID ] + "!" , player);
}
else if ( text == "scout" )
{
if ( work [ player.ID ] != "scout" )
{
player.Disarm( );
player.SetWeapon( 17 , 40 );
player.SetWeapon( 12 , 7 );
player.SetWeapon( 28 , 25 );
work [ player.ID ] = "scout";
MessagePlayer("[#00FFF7]You're a scout trooper now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You're already " + work [ player.ID ] + "!" , player);
}
else if ( text == "antitank" )
{
if ( work [ player.ID ] != "antitank" )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
work [ player.ID ] = "antitank";
MessagePlayer("[#00FFF7]You are an anti tanker now!",player);
player.IsFrozen = false;
}
else MessagePlayer("You are already " + work [ player.ID ] + "!" , player);
}
else MessagePlayer( "/job [ Assault / Scout / AntiTank ]" , player );
}
}

function onPlayerPart ( player , reason )
{
work [ player.ID ] = "";
}
Untested.
Sure, it could be, no doubt, but I really hate making the Cmds, for those ._. who just say I want, but the reason why I made this command, so like this cause, I guess he is too newbish to understand codes like that. my provided code could be more short like this
Code: [Select]
else if ( cmd== "assault")
{
if ( assaults[player.ID] != 1 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(121,250);
MessagePlayer("[#00FFF7]You Are A assault Man Now",player);
player.IsFrozen = false;
assaults[player.ID] = 1;
}
else ClientMessage("You have already selected the "Assault"",player,255,255,0);
}
else if ( cmd== "scount")
{
if ( scouts[player.ID] != 1  )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(28,25);
MessagePlayer("[#00FFF7]You Are A Sniper Man Now",player);
player.IsFrozen = false;
scouts[player.ID] = 1;
}
ClientMessage("You have already selected the Scout",player,255,255,0);
}
else if ( cmd== "antitank")
{
if ( antitanks[player.ID] != 1 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
MessagePlayer("[#00FFF7]You Are A AntiTanker Now",player);
antitanks[player.ID] = 1;
}
else ClientMessage("You have already selected the Anti-Tank",player,255,255,0);
}
but the reason why i didn't made it like yours, or it short to make his understanding better anyway, I seriously don't know how to explain; however, i didn't also seen him saying about job or anyway that's why i made it the way he provided the code.
P.S: - Well we can just say that everybody have their own algorithm.
3
Scripting and Server Management / Re: About command
« on February 21st, 2016, 09:02 AM »
Quote from Cena on February 21st, 2016, 07:46 AM
I make this cmds

Code: [Select]
else if ( cmd== "assault")
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(121,250);
MessagePlayer("[#00FFF7]You Are A assault Man Now",player);
player.IsFrozen = false;
}
else if ( cmd== "scout")
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(28,25);
MessagePlayer("[#00FFF7]You Are A Sniper Man Now",player);
player.IsFrozen = false;
}
else if ( cmd== "antitank")
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
MessagePlayer("[#00FFF7]You Are A AntiTanker Now",player);
player.IsFrozen = false;
}
but i want it like if someone use /antitank and after it try to use /scout or /assault server say to that player you cant use this cmd cuz you chose antitanker and also i want no one can use /antitank, /scout and /assault twice

i try to make this kind of thing but fail can some one help me?. ( thank you in admvance :) )
Put these arrays in the script, basically the main.nut we can say.
Code: [Select]
assaults <-array(GetMaxPlayers(),0);
scouts <-array(GetMaxPlayers(),0);
antitanks <-array(GetMaxPlayers(),0);
Code: [Select]
else if ( cmd== "assault")
{
if ( assaults[player.ID] != 1 )
{
if ( scouts[player.ID] == 0 )
{
if ( antitanks[player.ID] == 0 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(121,250);
MessagePlayer("[#00FFF7]You Are A assault Man Now",player);
player.IsFrozen = false;
assaults[player.ID] = 1;
}
else ClientMessage("You can't use the command since you are an AntiTanker",player,255,255,0);
}
else ClientMessage("You can't use the command since you are a Scount",player,255,255,0);
}
else ClientMessage("You have already selected the "Assault"",player,255,255,0);
}
else if ( cmd== "scount")
{
if ( scouts[player.ID] != 1  )
{
if ( assaults[player.ID] == 0 )
{
if ( antitanks[player.ID] == 0 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(28,25);
MessagePlayer("[#00FFF7]You Are A Sniper Man Now",player);
player.IsFrozen = false;
scouts[player.ID] = 1;
}
else ClientMessage("You can't use the command since you are an AntiTanker",player,255,255,0);
}
else ClientMessage("You can't use the command since you are a assaults",player,255,255,0);
}
else ClientMessage("You have already selected the "Scout"",player,255,255,0);
}
else if ( cmd== "antitank")
{
if ( antitanks[player.ID] != 1 )
{
if ( assaults[player.ID] == 0 )
{
if ( scouts[player.ID] == 0 )
{
player.Disarm();
player.SetWeapon(17,40);
player.SetWeapon(12,7);
player.SetWeapon(111,10);
MessagePlayer("[#00FFF7]You Are A AntiTanker Now",player);
antitanks[player.ID] = 1;
}
else ClientMessage("You can't use the command since you are a scount",player,255,255,0);
}
else ClientMessage("You can't use the command since you are a assaults",player,255,255,0);
}
else ClientMessage("You have already selected the "Assault"",player,255,255,0);
}
I basically created arrays to store the player data if they are selecting assaults/scount or any antitanks. Now to make the command "leave" || "left" you have to stand on your legs.
@KAKAN, he was basically asking, that how to get a message if the player have already selected a pacific men, job or whatever he says, so he can't use that command until he leave that particular men,job or whatever! you can understand by my command even.
4
Scripting and Server Management / Re: Command tells much.....
« on February 20th, 2016, 07:48 PM »
Quote from Doom_Kill3R on February 20th, 2016, 08:16 AM
Its not 'Dhoom'.

Destroyer, script executes in sequence so if you send the message first and store the data later what will happen? Common Sense.
Uhm, right! Thanks :)
5
Scripting and Server Management / Re: Command tells much.....
« on February 20th, 2016, 07:40 AM »
Quote from KAKAN on February 20th, 2016, 05:41 AM
Well, I got your problem now, here's the fixed code.
Code: [Select]
else if ( cmd =="bla")
{
local buffer = "";
    foreach( iPlayer in players ) if( GetKills( FindPlayer( iPlayer ) ) == 3 ) buffer = buffer + " " + FindPlayer( iPlayer ).Name;
if( buffer != "" ) ClientMessage("Players with 3 kills: [ " + buffer + " ]", player , 255, 255, 0 );
       else ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
}
Eh, it's already been fixed ._. i'm just waiting, for #Dhoom to answer why he didn't used the code in the 2nd row instead of 3rd. Anyway, for me I guess we did that cause we have to return something in end after all queries and stuff have been made, like just you did ._.
6
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 07:24 PM »
Quote from Doom_Kill3R on February 19th, 2016, 05:48 PM
I'm not putting it there just to avoid it from being called several times since it needs to be called only once. It may also interfere with the loop and may result wrong info.
Well, Dhoom Sir; actually the problem is that if we look to the Code, it isn't showing it once; however it is showing to those persons whom, it doesn't even have to show :|
7
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 05:05 PM »
Quote from KAKAN on February 19th, 2016, 04:47 PM
Quote from [TBS]Destroyer on February 19th, 2016, 04:35 PM
However it still gives the same error "Name" doesn't exist. ._.
Because we're using the instance as plr and not player.
Use this code:-
Code: [Select]
else if ( cmd =="bla")
{
    foreach( index, iPlayer in players )
    {
        local plr = FindPlayer( iPlayer );
            if( GetKills( plr ) == 3 ) ClientMessage( plr.Name + " is asking, for bla", plr /*It should be player I think*/ , 255, 255, 0 );
       else ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
    }
}
What's the point of this Cmd? it's works exactly same as
Code: [Select]
else if ( cmd =="bla")
 {
     
          foreach(a,val in players)
          {
                local plr = FindPlayer ( players[a].tointeger() ), b = 0;
                if ( plr )
                {
                        if (GetKills( plr ) == 3 )
                        {
                        b++;
                        ClientMessage("" + player.Name + " is asking, for bla",plr,255,255,0);
                       } 
                        if ( b == 0 ) ClientMessage("No player with 3 kills yet",player,255,255,0);
 
                     
                   }
                 
 
      }

}
man, Kakan :|
and as, for you, Xmair
Code: [Select]
else if ( cmd =="bla")
{
    local iCount;
 
    foreach( index, iPlayer in players )
    {
        local plr = FindPlayer( iPlayer );
        if( plr ) {
            if( GetKills( plr ) == 3 ) // You used iPlayer here, huh, such a momo =..=
            {
                iCount++;
                ClientMessage( player.Name + " is asking, for bla", plr, 255, 255, 0 ); // you nie define 'player'
            }
    }
Well, i've already changed iPlayer, to plr, forgot to tell lol sorry, but there is also a error that we were unable to see it was tiny, anyway I've to change
Code: [Select]
iCount
to
Code: [Select]
iCount = 0;
since iCount is null in that way, and we can't make it iCount++;
well the other thing is that i changed that code to this
Code: [Select]
if ( iCount == 0 )ClientMessage("BLA",player,255,255,0),iCount++;
which respectively just give it once even if their are hundred players together :P; However,nobody still didn't explained me why we didn't used that above the barrack -_-
Code: [Select]
else if ( cmd =="bla")
{
    local iCount = 0;
 
    foreach( index, iPlayer in players )
    {
        local plr = FindPlayer( iPlayer );
        if( plr ) {
            if( GetKill( plr ) == 3 )
            {
                iCount++;
                ClientMessage( player.Name + " is asking, for bla", plr, 255, 255, 0 );
            }
    }
 if ( iCount == 0 )ClientMessage("BLA",player,255,255,0), iCount++; // why we put this over here not above( before this barrack)

}
}
Edit: it just works fine, but -_- it really sucks at one point, it shows the message to the people who isn't even having the 3 kills :(
8
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 04:35 PM »
However it still gives the same error "Name" doesn't exist. ._.
9
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 04:31 PM »
Quote from Doom_Kill3R on February 19th, 2016, 04:25 PM
Code: [Select]
else if ( cmd =="bla")
{
    local iCount;
 
    foreach( index, iPlayer in players )
    {
        local plr = FindPlayer( iPlayer );
        if( plr ) {
            if( GetKills( iPlayer ) == 3 )
            {
                iCount++;
                ClientMessage( player.Name + " is asking, for bla", plr, 255, 255, 0 );
            }
    }

        if( iCount == 0 )
        ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
    }
}

I think you are storing IDs of player in the 'players' array so ofcourse we need to use FindPlayer to get the instance then use the Name var. We can't do that on ID.
else if ( cmd =="bla")
{
    local iCount;
 
    foreach( index, iPlayer in players )
    {
        local plr = FindPlayer( iPlayer );
        if( plr ) {
            if( GetKills( iPlayer ) == 3 )
            {
                iCount++;
                ClientMessage( player.Name + " is asking, for bla", plr, 255, 255, 0 );
            }
  if( iCount == 0 )
        ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
// why aren't you keeping this over here?   }

     
    }
}
10
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 04:17 PM »
Quote from Doom_Kill3R on February 19th, 2016, 04:07 PM
Your English is too weak, I can't exactly understand what you're trying to say. The code I gave you must work, yes that plr can be replaced. Change every 'player' or 'plr' to iPlayer and try.
Well, it's gives no error, but also shows nothing :|
11
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 03:09 PM »
Quote from Doom_Kill3R on February 19th, 2016, 12:43 PM
that's because you are running a foreach loop, the loop contains all the online players, that loop will loop as how many players are there, 2 players, twice, 3 players thrice and so forth. Have a look here
Code: [Select]
else if ( cmd =="bla")
 {
local iCount;

foreach( index, iPlayer in players)
{
if( iPlayer ) {

if( GetKills( iPlayer ) == 3 )
            {
iCount++;
ClientMessage( player.Name + " is asking, for bla",plr,255,255,0);
}
}

if( iCount == 0 )
ClientMessage( "No player with 3 kills yet",player,255,255,0);
}
}
Eh, Sir. #Dhoom, ._. as you can see "plr" doesn't exist in this whole cmd, sorry, I don't really like to point out mistake from your code, but anyway ._. the code doesn't worked, showed no error, but also doesn't worked.I even change plr to iPlayer.
Edit : - So I just changed a bit of these functions to this
else if ( cmd =="bla")
 {
   local iCount = 0;
   
   foreach( index, iPlayer in players)
   {
                local plr = FindPlayer ( iPlayer);
      if( iPlayer )
                     {
      
         if( GetKills( iPlayer ) == 3 )
            {
            iCount++;
            ClientMessage( player.Name + " is asking, for bla",plr,255,255,0);
         }
      }
      
      if( iCount == 0 ) ClientMessage( "No player with 3 kills yet",player,255,255,0);
   }
}Well as you can see changed
Code: [Select]
iCount;
to
Code: [Select]
iCount = 0;
to define that it's actually an integer, and just want to find the Players using FindPlayer, which made the function worked great, however in the first code plr wasn't defined, you can see in your Code, Sir Dhoom, but still :( i'm not getting why we didn't used
Code: [Select]
if( iCount == 0 ) ClientMessage( "No player with 3 kills yet",player,255,255,0);
in the second row, but however, it's a noobish thing, even if i can solve a code, I should really now the actually theme about it mean, like i just want to know why 3rd row, not the second? however it stills hows me thrice, forth, and etc. :(
12
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 02:59 PM »
Quote from KAKAN on February 19th, 2016, 01:32 PM
Well if you put it to 0 and there are no players online, then the 2nd message, which is at 1, will not appear.
It's something like:
Code: [Select]
if( player ){
if( player.IsSpawned ) iCount++;
if( iCount != 0 ) Message("NO!!!");
}
Now think, what would happen if there are no players? Will the message "NO!!!" will show up? Answer is no. In your case, it's the same. Hope you got it.
-_- i'm seriously thinking, it doesn't even make sense, Kakan, if there will be no players, so a ghost can't use this command( I mean obviously their would be some/one player in the server which used this cmd ).
I guess, I need more sensible reason here.
13
Scripting and Server Management / Re: Command tells much.....
« on February 19th, 2016, 01:03 PM »
Quote from Doom_Kill3R on February 19th, 2016, 12:43 PM
that's because you are running a foreach loop, the loop contains all the online players, that loop will loop as how many players are there, 2 players, twice, 3 players thrice and so forth. Have a look here
Code: [Select]
else if ( cmd =="bla")
 {
local iCount;

foreach( index, iPlayer in players)
{
if( iPlayer ) {

if( GetKills( iPlayer ) == 3 )
            {
iCount++;
ClientMessage( player.Name + " is asking, for bla",plr,255,255,0);
}
}

if( iCount == 0 )
ClientMessage( "No player with 3 kills yet",player,255,255,0);
}
}
Well, I guess it is surely gonna work, but just one question, i've seen many snippets being released on the other forum as your is also like them that, so, i'm curious to know the reason why we actually left space over their( in the code you will see), and sent the message(1) instead of not their(0)
Code: [Select]
else if ( cmd =="bla")
 {
local iCount;

foreach( index, iPlayer in players)
{
if( iPlayer ) {

if( GetKills( iPlayer ) == 3 )
            {
iCount++;
ClientMessage( player.Name + " is asking, for bla",plr,255,255,0);
}
//why we didn't wrote over here(0)
}

if( iCount == 0 ) // why we wrote over here ( 1 )
ClientMessage( "No player with 3 kills yet",player,255,255,0);// why we wrote over here ( 1 )
}
}
it's mostly like we do
Code: [Select]
if ( cmd == "bla " ) { if (  player.IsSpawned ) { if ( player.Vehicle ) { //bla } else ClientMessage("no spawned",player,255,255,0); } else ClientMessage("no vehicle",player,255,255,0) }
  as you can see it's not in rythm, and wrong message, it's in rythm
Code: [Select]
if ( cmd == "bla " ) { if (  player.IsSpawned ) { if ( player.Vehicle ) { //bla } else ClientMessage("no vehicle",player,255,255,0); } else ClientMessage("no spawned",player,255,255,0) }
so basically why the message isn't their in the first row, instead of 2nd ?
14
Scripting and Server Management / Command tells much.....
« on February 19th, 2016, 12:37 PM »
Hey, Folks! Well, I actually made this code
Code: [Select]
else if ( cmd =="bla")
 {
     
          foreach(a,val in players)
         {
                local plr = FindPlayer ( players[a].tointeger() ), b = 0;
                if ( plr )
                {
                        if (GetKills( plr ) == 3 )
                        {
                        b++;
                        ClientMessage("" + player.Name + " is asking, for bla",plr,255,255,0);
                       } 
                        if ( b == 0 ) ClientMessage("No player with 3 kills yet",player,255,255,0);
 
                     
                   }
                 
 
      }

}
As you can see, their isn't any kind of error, but the thing I actually want to ask, from you guys, that if their are 2 players in the server, and one is having 3 kills it returns 1 time( with 2 players)
Code: [Select]
ClientMessage("No player with 3 kills yet",player,255,255,0);
if nobody is having 3 kills it returns 2 times(with 2 players)
Code: [Select]
ClientMessage("No player with 3 kills yet",player,255,255,0);
,
Code: [Select]
ClientMessage("No player with 3 kills yet",player,255,255,0);
if 100, then 100 times( with 100 PLAYERS )
Code: [Select]
ClientMessage("No player with 3 kills yet",player,255,255,0);......
I've actually tried much to fix it, but unable to do, so, I don't have any algroithm to fix The messages of 2-100 times, I just want the message to come once, if their isn't any body with Kills, just once, do you guys have any idea how to fix this :(?
P.S : - Sorry, for my bad english, but hope you are getting what I mean.
EDIT: just want to ask that how can i return the message once, instead that the message is coming according to the number of Players who don't have 3 kills.
15
Scripting and Server Management / Re: Pickup help.
« on February 19th, 2016, 10:49 AM »
Quote from KAKAN on February 19th, 2016, 08:05 AM
Quote from Woodland on February 19th, 2016, 06:47 AM
Quote from KAKAN on February 19th, 2016, 05:49 AM
Remove is a function I guess, so use: pickup.Remove()
Its pickup.Remove(); @kakan :P
you forgot to add " ; "

ultimatejugo try like this, pickup.Remove();
Quote from Xmair on February 19th, 2016, 06:51 AM
Code: [Select]
Pickup.Remove();
Code: [Select]
pickup.Remove(); // Since squirrel is a case sensitive language, or try pickup.RespawnTime = 5000;
// Time in milliseconds.
Well, the thing, semicolon( ';' ) is not needed. I have many things without ';' and they work. @Xmair, I did the same.
Quote from {ultimateretard on February 19th, 2016, 06:44 AM
Quote from KAKAN on February 19th, 2016, 05:49 AM
Remove is a function I guess, so use: pickup.Remove()
thats the thing the pickup doesnt get removed
Well, you use the function as a variable, then how do you expect it to work, huh?

Well, this is the code, use it, or get rekt.
Code: [Select]
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The SHITTY Treasure!", player);
Pickup.Remove();
}
:( Kakan, why wrong?
Code: [Select]
Pickup.Remove
doesn't even exist :|
Ultimate change
Code: [Select]
Pickup.Remove();
to
Code: [Select]
pickup.Remove();
like this
Code: [Select]
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The Treasure!", player);
pickup.Remove();
}
}
since you didn't even defined Pickup*
P.S : - in simple word, P isn't defined anywhere.
Yeah it could be
Code: [Select]
local Pickup = FindPickup( pickup.ID );
then we can say
Code: [Select]
Pickup.Remove();
is still kinda correct.