Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - [VM_U]Spectra.PhantoM^

#21
I builded it this far:
else if (cmd == "setwep")
{
local plr = GetPlayer(GetTok(text, " ", 1));
if ( !text ) MessagePlayer( "[#ffd700]Syntax: /"+ cmd +" <playername>", player );
if (PlayerIsAdmin)
{
plr.GiveWeapon( text.tofloat(), 999 );
Message("[#ff0000]-> [#FF0000]Admin [#ffffff]"+ player.Name +" gave "+ plr.Name +"");
}
}
but it gives me error:
AN ERROR HAS OCCURED [cannot convert the string]
CALLSTACK
*FUNCTION [onPlayerCommand()] Main.nut line [407]
LOCALS
[plr] INSTANCE
[plr] INSTANCE
[i] 2
[text] " ult spas"
[cmd] "setwep"
[player] INSTANCE
[this] TABLE
Help fast plz. Thanx
#22
I was working on my own server. Built these. Now i know what ur gonna think that "Ultimate u nab this is useless" or  "Useless shit cmd".I TRYED people dont be rude down there in comments. Thanx.

function onPlayerCommand(player, command, arguments)
{
local params;
if (arguments != null) params = split(arguments, " ");
else params = split("", " ");

if (command == "forceeject")
{
local lvl = GetLevel( player );
if (params.len() < 1) EMessagePlayer(player, "Invalid parameters, /forceeject playername reason");

else if (GetLevel() < 7) EMessagePlayer(player,  "Command level too high");

else if (!FindPlayer(params[0])) EMessagePlayer(player,  "Unknown player %s", params[0]);

else

{

local plr = FindPlayer(params[0]);

local veh = player.Vehicle;
EMessageAll("Administrator %s has ejected %s.", player.Name, plr.Name, arguments.slice(params[0].len()));

plr.Eject();
}
return 1;
}

else if (command == "forcespawn")
{
local lvl = GetLevel( player );
if (params.len() < 1) EMessagePlayer(player, "Invalid parameters, /forcespawn playername reason");

else if (GetLevel() < 7) EMessagePlayer(player, "Command level too high");

else if (!FindPlayer(params[0])) EMessagePlayer(player, "Unknown player %s", params[0]);

else

{

local plr = FindPlayer(params[0]);

EMessageAll("Administrator %s has forced %s to spawn.", player.Name, plr.Name, arguments.slice(params[0].len()));

plr.Spawn();
}
return 1;

}

Updated.
function GetLevel( player )
{
local lvl =  GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Account WHERE Name='" + player.Name.tolower() + "'" ), 0 );
if ( lvl ) return lvl;
else return 0;
FreeSQLQuery( lvl );
}
#23
Ok...... I made cops and robbers commands by my self:
else if ( cmd == "cuff" )
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("[Invalid Player.", player );
else
{
Message(""+ player + " Has Cuffed "+ plr + "");
plr.IsFrozen = true;
}
}

else if ( cmd == "uncuff" )
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("Invalid Player.", player );
else
{
Message(""+ player + " Has Un-Cuffed "+ plr + "");
plr.IsFrozen = false;
}
}

else if ( cmd == "arrest" )
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("Invalid Player.", player );
if ( plr.IsFrozen == false ) MessagePlayer("That Player Is Either Not Cuffed Or He Isnt Wanted", player);
else
{
Message(""+ player + " Has Arrested "+ plr + "");
plr.Pos = Vector(391.039, -506.887, 9.39561 );
plr.IsFrozen = true;
}
}

Its all working well till i add the line:
if ( player.pos = plr.pos == false) MessagePlayer(" you need to be close to "+plr+"to cuff him/her.",player);when i add this line the whole server crashes....
Any help plz.
#24
ok i added vip skin in my server that has cool custom weapons and all the benefits of vip but.... all people(NOT VIP) can spawn in that skin. can anyone give me a restriction code that when a player below lvl 2 tries to spawn in that skin he will get auto killed?

Thanx
#25
else if (command == "forcespawn")
{
if (params.len() < 1) EMessagePlayer(player,  "Invalid parameters, /disarm playername reason");

else if (player.Level() < 7) EMessagePlayer(player, "Command level too high");

else if (!FindPlayer(params[0])) EMessagePlayer(player, "Unknown player %s", params[0]);

else

{

local plr = FindPlayer(params[0]);

EMessageAll("Administrator %s has forced %s to spawn.", player.Name, plr.Name, arguments.slice(params[0].len()));

plr.Spawn = true;
}
return 1;

}

I've done till this part but it gives me error Member variable not found can anyone tell me anything to put in place of plr.Spawn;?
#26
Snippet Showroom / Loan And PayLoan Cmd
Dec 22, 2015, 08:10 AM
function onPlayerCommand( player, cmd, text )
{
else if ( cmd == "loan" )
{
local cash = status[ player.ID ].Cash;
local add = cash + 20000;
status[ player.ID ].Cash = add;
player.Cash = add;
Message("" +player.Name+ " took a loan of 20k. ");
}
}

Easy as hell. This Makes Ur Cash Go Up To 20000$ (You can edit cash amount by editing local add default value is 20k) And also pay loan :
else if ( cmd == "payloan" )
{
local cash = status[ player.ID ].Cash;
local det = cash - 20000;
status[ player.ID ].Cash = det;
player.Cash = det;
Message("[#ff0000]" +player.Name+ " [#ffffff]payed his loan of 20k. ");
}
}

@S.L.C Updated Post
#27
Snippet Showroom / Auto Messages
Dec 21, 2015, 11:46 AM
This Makes Messages appear on the chat every (idk) 10 secs
auto_msgs <-
[
" Your message here."];
randcolors <-
[
        "[#DC143C]"
        "[#00CED1]"
        "[#FF69B4]"
        "[#FF8C00]"
        "[#FFFF00]"
        "[#800080]"
        "[#4169E1]"
        "[#2E8B57]"
        "[#8B4513]"
        "[#C0C0C0]"
 


        "[#FF0000]"
        "[#FF1493]"
        "[#FF4500]"
        "[#191970]"
        "[#8A2BE2]"
        "[#4B0082]"
        "[#ADFF2F]"
        "[#20B2AA]"
        "[#00FFFF]"
        "[#DAA520]"
        "[#696969]"


        "[#FF00FF]"
        "[#B22222]"
        "[#FF7F50]"
        "[#BDB76B]"
        "[#32CD32]"
        "[#1E90FF]"
        "[#008000]"
        "[#008080]"
        "[#B8860B]"
        "[#708090]"


        "[#8B0000]"
        "[#FFD700]"
        "[#BA55D3]"
        "[#9400D3]"
        "[#00BFFF]"
        "[#00FF00]"
        "[#00FA9A]"
        "[#D2691E]"


        "[#FA8072]"
        "[#C71585]"
        "[#FFA500]"
        "[#4682B4]"
        "[#7CFC00]"
        "[#3CB371]"
        "[#808000]"
        "[#9ACD32]"
        "[#8B4513]"
        "[#2F4F4F]"

      ];

      randcolorsirc <-
      [
      "\x000300"
      "\x000301"
      "\x000302"
      "\x000303"
      "\x000304"
      "\x000305"
      "\x000306"
      "\x000307"
      "\x000308"
      "\x000309"
      "\x000310"
      "\x000311"
      "\x000312"
      "\x000313"
      "\x000314"
      "\x000315"
      ]
       
  function sendmsgs()

  Message( auto_msgs[ rand() % auto_msgs.len() ]);
}     


Copy this all and make a different file rename it to .nut then do this:
function onScriptLoad()
{

dofile( "scripts/yourscriptnamehere.nut" )

Now messages will show up on ur screen :P

Remember always add , at the end of a message and ]; at the end of ur last message for example:

"yourmessage",
"yoursecondmessage"];

#28
Scripting and Server Management / /park help
Dec 19, 2015, 11:15 AM
can someone give me a cmd of /park?
#29
Ye. most people just spam in these topics for port forwarding......
So plz i request u people to look at this and dont spam

First type 192.168.1.1 in ur browser as shown :


NOTE: Everyone doesnt (Or Does) Have a same gateway IP so to solve that open cmd.exe from Start menu:


Now Open cmd and type ipconfig it should look like this:


Now Type what ever gateway ip u see in cmd and type in browser. After that you will get a page asking for username + pass LIKE THIS:


Now all of u might and (might not) have the same. but just type admin (Without caps) and password will be given on the bottom of router

After u enter the password and username ull get a screen like this:


Now press the advance settings ull get a screen like this: Mine is ptcl so urs might be different:


NOTE: i have already port forwarded so it might be not showing VCMP

Now press add you will get a page like this:


Select Custom Service and type VCMP (If u are port forwarding for something else then

Now enter a port in the External port start and end (SUGGESTED would be 8192)
NOTE: U dont have to enter different ports in the Port Start Or in Port End u can just add one port only

Now type save like this:


Boom port forwarded Quite easy though. HOPE this helped.



#30
OK. how the heck do i make custom vehicles available for others to download and use in server?