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.

Topics - wilber32
1
Snippet Showroom / Anti-Lag
« on December 20th, 2015, 05:28 PM »
hi, friends today will show you an antilag to clear to everyone who sees porn as they play. :V

Code: [Select]
function onPlayerSpawn()
{
if (player.Ping >= the amount you want  )
{
Message("Auto-Kicked:[ " + player.Name + " ] Reason:[ Execeeded ping 750ms ]");
player.Kick();
}
}

Credits: [ZG]Luis, Wilber32
2
Snippet Showroom / Anti-Spawnkill [fixed up]
« on December 11th, 2015, 11:31 PM »
Hello scripts of VCMP-0.4, Today I will show my spawn kill  [Caveat] No is copy! It is modified follow my steps

PlayerClass
Code: [Select]
{
AntiSP = false;
}

function onPlayerSpawn( player )
Code: [Select]
{
SP( player );
}

function onPlayerKill( player, killer, reason, bodypart )
Code: [Select]
{
 if ( stats[player.ID].AntiSP = true )
 {
  player.Health = 0;
  Message( "++ Auto-kill:[ " + player.Name + " ]. Reason:[ Spawn-Kill ]" );
 }
}

Functions

Code: [Select]
function SP( player )
{
 stats[player.ID].AntiSP = true;
  MessagePlayer( "Spawnkil [ON]", player );
 NewTimer( "SPoff", 5000, 1, player.ID );
}

function SPoff( player )
{
local player = FindPlayer(player);
if(player){
 stats[player.ID].AntiSP = false;
 MessagePlayer( "Spawnkil [OFF]", player );
}
}

credits by  [NxR]Wilber32.

3
Scripting and Server Management / Getstats Problem
« on December 6th, 2015, 03:56 PM »
function GetStats( player )
{
      local stats = null;
           local Kills = stats[ player.ID ].Kills;
           local Deaths = stats[ player.ID ].Deaths;
           {
      if ( ( Kills < 0 ) && ( Deaths < 0 ) )
      {
          local ratio = format( "%.2f", Kills.tofloat() / Deaths.tofloat() );
          stats = "Kills: " + Kills + ", Deaths: " + Deaths + ", Ratio: " + ratio + ", Joins: " + Joins + ".";
      }
           else
      {
          stats = "Kills: " + Kills + ", Deaths: " + Deaths + ", Joins: " + Joins + ".";
      }
           }
      return stats;
      }

the index " 0 " not exist
4
Scripting and Server Management / error in spawnkill
« on November 27th, 2015, 11:09 PM »
when I spawn and spend time spawnkill inserted console "stopped working and closes automatically"

Code: [Select]
function onScriptLoad()
{
AntiSP <- array( GetMaxPlayers(), null );
}

function onPlayerSpawn( player )
{

SP( player );

}

function onPlayerHealthChange( player, oldhp, newhp )
{

if ( AntiSP[ player.ID ] == true )
{
player.Health = 100;
}

}

function onPlayerKill( killer, player, reason, bodypart )
{

if ( AntiSP[ player.ID ] == true )
{
killer.Health = 0;
PrivMessage( "Spawn-Kill not allowed!", killer );
MessageAllExcept( "** Auto-kill:[ " + killer.Name + " ]. Reason:[ Spawn-Kill ]", killer );
}

}

function SP( player )
{
AntiSP[ player.ID ] = true;
NewTimer( "SPoff", 5000, 1, player );
PrivMessage( "Anti Spawn-Kill:[ ON ]", player );
}

function SPoff( player )
{
AntiSP[ player.ID ] = false;
PrivMessage( "Anti Spawn-Kill:[ OFF ]", player );
}
5
Snippet Showroom / prop system
« on November 20th, 2015, 12:09 AM »
Hello Today I will show you a system, that will help, First follow the steps:

-- Removed --
6
Scripting and Server Management / help stats!
« on November 17th, 2015, 02:34 AM »
I want to have a system of statistics will not know create D: Hotdogcat He told me I have to do it myself but much is not fuck with server
7
Scripting and Server Management / help!
« on November 16th, 2015, 01:20 AM »
When I add joins in this system tells me an error,  How to add Joins?
Code: [Select]
class PlayerClass{
// ------------------------------------------------------------------- //

LastUsedIP = "0.0.0.0";
Cash = 0;
Bank = 0;
Kills = 0;
Deaths = 0;
Level = 0;
Logged = false;

// ------------------------------------------------------------------- //

constructor( playerName, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP FROM Accounts WHERE Name='" + playerName + "' AND NameLower='" + playerName.tolower() + "'" );
if( ::GetSQLColumnData( query, 5 ) ){
Cash = ::GetSQLColumnData( query, 0 );
Bank = ::GetSQLColumnData( query, 1 );
Kills = ::GetSQLColumnData( query, 2 );
Deaths = ::GetSQLColumnData( query, 3 );
Level = ::GetSQLColumnData( query, 4 );
LastUsedIP = ::GetSQLColumnData( query, 5 );
}
::FreeSQLQuery( query );
}

function Join( player ){
if( Level == 0 ){
::MessagePlayer( "Please register to play.", player );
::MessagePlayer( "Register with /register <password>", player );
}
else if( LastUsedIP == player.IP ){
Logged = true;
::MessagePlayer( "Welcome back!", player );
}
else{
::MessagePlayer( "Please login to play.", player );
::MessagePlayer( "Login with /login <password>", player );
}
}

function Update( player, dbGlobal ){
::QuerySQL( dbGlobal, "UPDATE Accounts SET Cash=" + Cash + ", Bank=" + Bank + ", Kills=" + Kills + ", Deaths=" + Deaths + ", Level=" + Level + ", LastUsedIP='" + LastUsedIP + "' WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
}

function Register( player, password, dbGlobal ){
::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "')" );
Level = 1;
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "Successfully registered.", player );
::MessagePlayer( "Don't forget your password. [" + password + "]", player );
}

function Login( player, password, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Password FROM Accounts WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
if( ::GetSQLColumnData( query, 0 ) == null ){
::MessagePlayer( "You are not registered.", player );
}
else if( ::SHA256( password ) != ::GetSQLColumnData( query, 0 ) ){
::MessagePlayer( "Wrong password.", player );
}
else{
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "Successfully logged in.", player );
}
}
}
data base
Code: [Select]
CREATE TABLE Accounts ( Name VARCHAR(255), NameLower VARCHAR(255), Password VARCHAR(255), Cash INT, Bank INT, Kills INT, Deaths INT, Level INT, LastUsedIP VARCHAR(255) )
8
Snippet Showroom / Functions money modified
« on August 30th, 2015, 04:35 PM »
This to functions
Code: [Select]
function DecCash( player, amount )
{
local cash = stats[ player.ID ].Cash;
local det = cash - amount;
stats[ player.ID ].Cash = det;
player.Cash = det;
}

function IncCash( player, amount )
{
local cash = stats[ player.ID ].Cash;
local add = cash + amount;
stats[ player.ID ].Cash = add;
player.Cash = add;
}

function IncKills( player, amount )
{
local kills = stats[ player.ID ].Kills;
local add = kills + amount;
stats[ player.ID ].Kills = add;
}

function IncKilleds( player, amount )
{
local killeds = stats[ player.ID ].Killeds;
local add = killeds + amount;
stats[ player.ID ].Killeds = add;
}

function IncDeaths( player, amount )
{
local deaths = stats[ player.ID ].Deaths;
local add = deaths + amount;
stats[ player.ID ].Deaths = add;
}
function DecBank( player, amount )
{
local bank = stats[ player.ID ].Bank;
local det = bank - amount;
stats[ player.ID ].Bank = det;
}
function IncBank(player,amount)
{
local bank = stats[ player.ID ].Bank;
local add = bank + amount;
stats[ player.ID ].Bank = add;
}

This to Main.nut
Code: [Select]
else if ( cmd == "deposit" )
{
local status = stats;
local Cash = status[ player.ID ].Cash;
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].IsReg == false ) MessagePlayer( "[#FF0000][ERROR]You are not registered.", player );
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer( "[#FF0000][ERROR]You are not logged in.", player );
else if ( !text ) MessagePlayer( "[#570057][Syntax]: /deposit [Amount/All]", player );
else if( checkpoly == false ) MessagePlayer( "[#ff0000]You have to be at the bank.", player );
else if ( status[ player.ID ].Cash == 0 ) MessagePlayer( "[#ff0000]You have no money.", player );
else {
if( text == "all" )
{local pcash = status[ player.ID ].Cash;
if( pcash > 0 ) {
DecCash( player, pcash );
IncBank( player, pcash );
MessagePlayer( "[#005703]you have deposited: ["+ pcash +"] to your account.", player );
local Bank = status[ player.ID ].Bank;
MessagePlayer( "[#005703]your new balance is: [ $"+Bank+" ].", player );
}
}
else if ( !IsNum( text ) )  MessagePlayer( "[#ff0000][ERROR]the amount should be in numbers.", player );
else if ( Cash < text.tointeger() ) MessagePlayer( "[#ff0000][ERROR]You have no money.", player );
else {
local text = text.tointeger();
DecCash( player, text );
IncBank( player, text );
MessagePlayer( "[#005703]you deposit [$"+ text +"] to your account.", player );
local Bank = status[ player.ID ].Bank;
MessagePlayer( "[#005703]your new balance is: [ $"+Bank+" ].", player );
}
}
}


else if ( cmd == "givecash" )
{
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( stats[ player.ID ].IsReg == false ) MessagePlayer( "[#FF0000][ERROR]You are not registered.", player );
else if ( stats[ player.ID ].IsLogged == false ) MessagePlayer( "[#FF0000][ERROR]You are not logged in.", player );
else if ( !player.IsSpawned ) MessagePlayer( "[#ff0000][ERROR]You have not done spawn", player );
else if( checkpoly == false ) MessagePlayer( "[#ff0000][ERROR]You have to be at the bank.", player );
else if ( !text )
{
MessagePlayer( "[#570057][Syntax]: /givecash [monto] [Nick/ID]", player );
return;
}
else if ( !IsNum( text ) )  MessagePlayer( "[#ff0000][ERROR]the amount should be in numbers.", player );
else {
local plr = GetPlayer( GetTok( text, " ", 2 ) );
if ( !plr ) MessagePlayer( "[#ff0000][ERROR] Player Unknow", player );
else if (plr.ID == player.ID) MessagePlayer( "[#ff0000][ERROR]you can not do yourself",player);
else {
local Poss = plr.Pos,checkpolyy;
checkpolyy = InPoly( Poss.x, Poss.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpolyy == false ) {MessagePlayer( "[#ff0000]You have to be at the bank.", player ); MessagePlayer( "[#ff0000]"+player.name+"should be in the bank.",plr);}
else {
if ( text.tointeger() > player.Cash ) MessagePlayer( "[#ff0000][ERROR]Invalid amount.", player );
else if (!IsNum(GetTok( text, " ", 1 ) ) ) MessagePlayer( "[#ff0000][ERROR]the amount should be in numbers.", player );
else if ( text.tointeger() < 0 ) MessagePlayer( "[#ff0000][ERROR]Invalid amount.", player );
else {
DecCash( player, text.tointeger() );
IncCash( plr, text.tointeger() );
MessagePlayer( "[#005703]You have given $" + text.tointeger() + " to " + plr.Name + "",player);
MessagePlayer( "[#005703]"+player.Name+" gave you $" + text.tointeger() + "Do not spend on marijuana!.",plr);
}
}
}
}
}

else if ( cmd == "withdraw" )
{
local status = stats;
local Bank = status[ player.ID ].Bank;
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y,  -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].IsReg == false ) MessagePlayer( "[#FF0000][ERROR]You are not registered.", player );
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer( "[#FF0000][ERROR]You are not logged in.", player );
else if ( !text ) MessagePlayer( "[#570057][Syntax]: /withdraw [Amout/All]", player );
else if ( checkpoly == false ) MessagePlayer( "[#ff0000][ERROR]You have to be at the bank.", player );
else if ( status[ player.ID ].Bank == 0 ) MessagePlayer( "[#ff0000][ERROR]You have no money in the bank", player );
else {
if( text == "all" )
{local pbank = status[ player.ID ].Bank;
if( pbank > 0 ) {
DecBank( player, pbank );
IncCash( player, pbank );
MessagePlayer( "[#005703]you have taken: [ $"+Bank+" ] your account.", player );
}
}
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][ERROR]the amount should be in numbers.", player );
else if ( Bank < text.tointeger() ) MessagePlayer( "[#ff0000][ERROR]You do not have money", player );
else {
local text = text.tointeger();
DecBank( player, text );
IncCash( player, text );
MessagePlayer( "[#005703]you have taken: [ $"+text+" ] your account.", player );
}
}
}

  else if ( cmd == "cash" )
  {
      if ( !text ) MessagePlayer( "[#570057][Syntax]: /cash <Nick/ID>", player );
  else
  {
     local plr = GetPlayer( text );
if ( !plr ) MessagePlayer( "[#ff0000][Error] - Invalid Player", player );
                         if ( stats[ player.ID ].IsReg == false ) MessagePlayer( "[#FF0000][ERROR]You are not registered.", player );
else MessagePlayer( plr.Name + "'[#005703]s Cash: $" + stats[ plr.ID ].Cash + " Bank: $" + stats[ plr.ID ].Bank + "", player );
  }
  }

this is for those who spoke of my, Now I showed that his words no value does not convince me. Here I is modified by me my server DM
9
Snippet Showroom / Money system
« on August 29th, 2015, 10:24 PM »
class PlayerStats
Code: [Select]
{
IsReg = false;
IsLogged = false;

Cash = 0;
Bank = 0;

}

function onPlayerCommand
Code: [Select]
else if ( cmd == "givecash" )
{
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].IsReg == false ) MessagePlayer(RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Registered First!", player );
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Logged-In First!", player );
else if ( !player.IsSpawned ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"First Spawned And Then Use It.", player );
else if( checkpoly == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Have To Be At Bank.", player );
else if ( !text )
{
MessagePlayer(ORANGE+"Usage: /givecash [Amount] [Nick/ID]", player );
return;
}
else if ( NumTok( text, " " ) < 2 ) MessagePlayer(ORANGE+"Usage: /givecash [Amount] [Nick/ID]", player );
else {
local plr = GetPlayer( GetTok( text, " ", 2 ) );
if ( !plr ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Invalid Player.", player );
else if (plr.ID == player.ID) MessagePlayer(RED+"** [DNUS-Error]: >> "+ORANGE+"You Don't GiveCash To Himself!",player);
else {
local Poss = plr.Pos, checkpolyy;
checkpolyy = InPoly( Poss.x, Poss.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpolyy == false ) {MessagePlayer(RED+"** [DNUS-Error]: >> "+ORANGE+"This Player Isn't In The Bank.", player ); MessagePlayer(RED+"** [Notice]: >> "+ORANGE+""+player.Name+" Want Came You In The Bank For Giving Money!",plr);}
else {
if ( text.tointeger() > player.Cash ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Invalid Amount!", player );
else if (!IsNum(GetTok( text, " ", 1 ) ) ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Ammount Must Be In Numbers!", player );
else if ( text.tointeger() < 0 ) MessagePlayer( RED+"** >> Sending Failed! "+ORANGE+"Please Use The Correct Way To Send.", player );
else {
DecCash( player, text.tointeger() );
IncCash( plr, text.tointeger() );
MessagePlayer(BLUE+"** >> You Given $" + text.tointeger() + " Rupees To " + plr.Name + "",player);
MessagePlayer(BLUE+"** >> "+player.Name+" Given You $" + text.tointeger() + " Rupees!",plr);
}
}
}
}
}

else if ( cmd == "deposit" )
{
local Cash = status[ player.ID ].Cash;
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].IsReg == false ) MessagePlayer(RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Registered First!", player );
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Logged-In First!", player );
else if ( !text ) MessagePlayer(ORANGE+"Usage: /deposit [Ammout/All]", player );
else if( checkpoly == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Have To Be At Bank.", player );
else if ( status[ player.ID ].Cash == 0 ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Not Enough Money.", player );
else {
if( text == "all" )
{local pcash = status[ player.ID ].Cash;
if( pcash > 0 ) {
DecCash( player, pcash );
IncBank( player, pcash );
MessagePlayer(ORANGE+"** >> You Have Deposited:[ "+pcash+" ] Into Your Bank Account.", player );
local Bank = status[ player.ID ].Bank;
MessagePlayer(YELLOW+"** >> Your New Bank Balance:[ $"+Bank+" ].", player );
}
}
else if ( !IsNum( text ) )  MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Amount Must Be In Numbers.", player );
else if ( Cash < text.tointeger() ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Not Enough Money.", player );
else {
local text = text.tointeger();
DecCash( player, text );
IncBank( player, text );
MessagePlayer(ORANGE+"** >> You Have Deposited:[ $"+text+" ] Into Your Bank Account.", player );
local Bank = status[ player.ID ].Bank;
MessagePlayer(YELLOW+"** >> Your New Bank Balance:[ $"+Bank+" ].", player );
}
}
}

else if ( cmd == "withdraw" )
{
local Bank = status[ player.ID ].Bank;
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y,  -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].IsReg == false ) MessagePlayer(RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Registered First!", player );
else if ( status[ player.ID ].IsLogged == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Need To Logged-In First!", player );
else if ( !text ) MessagePlayer(ORANGE+"Usage: /withdraw [Amount/All]", player );
else if ( checkpoly == false ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"You Have To Be At Bank.", player );
else if ( status[ player.ID ].Bank == 0 ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Not Enough Money.", player );
else {
if( text == "all" )
{local pbank = status[ player.ID ].Bank;
if( pbank > 0 ) {
DecBank( player, pbank );
IncCash( player, pbank );
MessagePlayer(BLUE+"** >> You Have Withdrawed:[ $"+Bank+" ] From Your Bank Account.", player );
}
}
else if ( !IsNum( text ) ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Ammount Must Be In Numbers!", player );
else if ( Bank < text.tointeger() ) MessagePlayer( RED+"** [DNUS-Error]: >> "+ORANGE+"Not Enough Money!", player );
else {
local text = text.tointeger();
DecBank( player, text );
IncCash( player, text );
MessagePlayer(BLUE+"** >> You Have Withdrawed:[ $"+text+" ] From Your Bank Account.", player );
}
}
}

Functions
Code: [Select]
function DecCash( player, amount )
{
local cash = status[ player.ID ].Cash;
local det = cash - amount;
status[ player.ID ].Cash = det;
player.Cash = det;
}
function IncCash( player, amount )
{
local cash = status[ player.ID ].Cash;
local add = cash + amount;
status[ player.ID ].Cash = add;
player.Cash = add;
}
function DecBank( player, amount )
{
local bank = status[ player.ID ].Bank;
local det = bank - amount;
status[ player.ID ].Bank = det;
}
function IncBank(player,amount)
{
local bank = status[ player.ID ].Bank;
local add = bank + amount;
status[ player.ID ].Bank = add;
}

10
Scripting and Server Management / like putting on sale the cars? :(
« on August 14th, 2015, 03:07 PM »
help me please, I need car sales :( help!