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 - AroliS^
1
Client Scripting / Real Time
« on May 20th, 10:53 PM »
it is working great!
Code: [Select]
   
function Script::ScriptProcess()
{     
local time = System.GetDate( System.GetTimestamp( ), 'r' );
::time[ "date" ].Text = time.hour +" : "+ time.min;
}

in somewhere in your clientside's script!
Code: [Select]
function labelcreator( pos, colour, resizable )
{
local ui = GUILabel( pos, colour, resizable );
return  ui;
}

::time <-
{
date = labelcreator( VectorScreen( sX * 0.671, sY * 0.115 ), Colour( 255, 255, 255 ), true )
}

::timer[ "date" ].FontSize = sX * 0.025;




pastebin - https://pastebin.com/YUZPZkxz
2
Support / findmemberclan something wrong with it?
« on February 24th, 08:39 PM »
this is a simple function to find clan members that i made

function FindMemberClan( player )
{
local q = QuerySQL( clanstat, "SELECT * FROM ClanUsers WHERE Clans LIKE '"+GetTag( player.Name )+"'" );
if ( q )
{
if (  GetSQLColumnData( q, 1 ) == player.Name )
{
 _MessagePlayer( white+"[ "+pink+GetTag( player.Name )+white+" ]- MEMBER: "+purple+TruncateClan( player.Name )+"", white+"[ "+pink+GetTag( player.Name )+white+" ]- MIEMBRO: "+purple+TruncateClan( player.Name )+"", player );
}
 else
{
 _MessagePlayer("You are not "+GetTag( player.Name )+" member you will be jailed and then kicked.", "No eres miembro de el clan "+GetTag( player.Name )+", seras encarcelado y despues kickeado.", player)
}
}
  FreeSQLQuery( q )
}

but only the first player registered in clan's database is recognized as a member what is wrong with it? here some pictures...

this is the database the first player is recognized as member the second one as not clan member.


first account, recognized.



second account, not recognized.
3
Snippet Showroom / Simple spectate system by Eros
« on January 28th, 10:43 PM »
Everything is explained on scripts.

i maked Newtimer for it but i did n't test if you want spectate system with newtimer try it but if you don't wanna just live it like that.

onScriptLoad()
Code: [Select]
spec <- false;

playerspawn
Code: [Select]
player.SpectateTarget = null;

playerClass
Code: [Select]
spec      = false;

spectate cmd
Code: [Select]
else if ( cmd == "spectate" )
{
local id = player.ID;
if ( player.Vehicle ) ::MessagePlayer( E + "You can't use this commnad using a vehicle.",player)
else if ( !text ) ::MessagePlayer(C + EROS + cmd + " <plr/off> ", player );
else if (text=="off")
{
//delete those thing & change it for newtimer(specoff)
if ( pstatus[id].spec == false )
{MessagePlayer( "You are not in spectate mode.", player );}
else if ( pstatus[id].spec == true )
{::DM( "You left specate mode.", player );}
pstatus[id].spec = false;
spec = false;
player.SpectateTarget = false;
player.IsFrozen = false;
player.Immunity = ( 0 );
//delete those thing & change it for newtimer(specoff)
}
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) ::MessagePlayer(E + "Invalid Player.", player );
else if ( plr.ID == id ) ::MessagePlayer( E + "You can not use spec on you.", player );
else if ( !plr.IsSpawned ) ::MessagePlayer( E + plr.Name + " has to choose a skin fisrt.", player );
else
{
//delete those thing & change it for newtimer(specon)
::DM(  ""+orange+"[SPEC] "+ white +" You are spectating to " + purple + plr.Name + white + " ID: " + id + " :: to exit use /spectate off",player );
player.Immunity = ( 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 32 | 64 | 128 );
pstatus[player.ID].spec = true;
spec = true;
player.SpectateTarget = plr;
//delete those thing & change it for newtimer(specon)
}
}
return 0;
}

the cmd work even without this, i added this just if you want the cmd with timer :3
Newtimers are not tested

place it on cmd
Code: [Select]
NewTimer( "specoff", 3000, 1, player.ID );
::MessagePlayer( "[#cccccc]wait 3 secs", player );
place it on function.nut
Code: [Select]
function specoff( player )
{
try
{
player = FindPlayer( player );
if ( player )
{
if ( pstatus[ player.ID ].spec == false )
{MessagePlayer( "You are not in spectate mode.", player );}
else if ( pstatus[ player.ID ].spec == true )
{::DM( "You left specate mode.", player );}
pstatus[player.ID].spec = false;
spec = false;
player.SpectateTarget = false;
player.IsFrozen = false;
player.Immunity = ( 0 );
}
}
catch(e)
MessagePlayer("error "+e,player)
}

specon function
place it on cmd
Code: [Select]
NewTimer( "specon", 3000, 1, player.ID, plr.ID );
::MessagePlayer( "[#cccccc]wait 3 secs", player );
player.IsFrozen = true;
place it on function.nut
Code: [Select]
function specon( player, plr )
{
try
{
player = FindPlayer( player );
plr = FindPlayer( plr );
if ( player )
{
if( plr )
::DM(  ""+orange+"[SPEC] "+ white +" You are spectating to " + purple + plr.Name + white + " ID: " + plr.ID + " :: to exit use /spectate off",player );
player.Immunity = ( 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 32 | 64 | 128 );
pstatus[player.ID].spec = true;
spec = true;
player.IsFrozen = true;
player.SpectateTarget = plr;
}
}
catch(e) ::MessagePlayer("error "+e,player)
}
4
Support / onPlayerChat
« on January 28th, 05:18 AM »
this is my rChat i want that when one player is in wolrd 2 show this one



but is replying 2 times, what can i do with it??

5
Support / setpass help!!
« on January 19th, 03:22 AM »
Code: [Select]
if ( cmd == "setpass" || cmd == "newpassword" )
{
if ( !text ) MessagePlayer( " /"+ cmd +" <plr> <pass>", player );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) ::MessagePlayer( "Unknown Player.", player );
else
}
local pass = GetTok( text, " ", 2);
if ( !pass ) ::MessagePlayer( cmd + " <plr> <pass>", player );
else
{
local password = SHA256( pass );
QuerySQL( db, "UPDATE Accounts SET Password='" + password + "' WHERE Name='" + plr.Name + "'" );
::MessagePlayer( "You changed " + plr.Name + " password to: " + pass, player );
::MessagePlayer( "[#FFD700]** [ADMIN][#9400D3] " + player.Name + "[#FFFFFF] change ur password: " + pass, plr );
}
return 0;
}

something is wrong when i changed someone password /login don't read sha256 passwords this is what i have on login command 

Code: [Select]
if ( SHA256(text) != GetPass( player ) ) return ::MessagePlayer( "Wrong password. [" + pstatus[ player.ID ].Warnlogg + "/3]", player );
           
the current account with yellow is how my setpass do sha256 password and the other are when players use /register + password   


6
Snippet Showroom / Spawnloc system
« on November 18th, 2018, 06:46 PM »
I modify this system : https://forum.vc-mp.org/?topic=5189.msg37267#msg37267
::MSN = MessagePlayer
::SMS = MessagePlayer
::PM = MessagePlayer
EROS = "/"

onScriptLoad()
(click to show/hide)
locs <- ConnectSQL( "datas/locs.db" );
QuerySQL( locs, "CREATE TABLE IF NOT EXISTS spawn ( Autospawn TEXT, xaxis VARCHAR(25), yaxis VARCHAR(25), zaxis VARCHAR(25), Name VARCHAR(32) )" );

function onPlayerCommand(player, command, arguments)
(click to show/hide)
else if ( cmd == "spawnloc" )
{
if ( check( player, null ) ) return 0;
else if ( player.Vehicle ) ::MSN( "[#cccccc]You are on a vehicle.", player );
else if ( !player.IsSpawned ) ::MSN("[#ff0000]Choose a skin before use it", player );
local q = QuerySQL( locs, "SELECT Autospawn FROM spawn WHERE Name='" + player.Name + "'");
if ( !text ) ::SMS( "/" + cmd + " <on/off>", player );
else
{
if ( text == "on" )
{
if ( GetSQLColumnData(q, 0 ) == "true" ) ::MSN( "You already did.", player );
else
{
pstatus[ player.ID ].SpawnLoc = true;
QuerySQL(locs, "UPDATE spawn SET Autospawn = 'true' WHERE Name = '" + player.Name + "'");
::PM( "Activate! to choose a place. "+azul+"Use /spawnloc set.", player );
}
}
else if ( text == "off" )
{
if ( GetSQLColumnData(q, 0 ) == "false" ) ::MSN( "You already did.", player );
else
{
pstatus[ player.ID ].SpawnLoc = false;
QuerySQL(locs, "UPDATE spawn SET Autospawn = 'false' WHERE Name = '" + player.Name + "'");
::PM( "Spawnloc desactivate!", player );
}
}
else if ( text == "set" )
{
if ( pstatus[ player.ID ].SpawnLoc == false ) ::MSN("Your spawnloc is "+azul+"[ "+ GetSQLColumnData(q, 0 ) +" ],"+blanco+" Use /spawnloc on!!.", player );
else
{
 local q = QuerySQL(locs, "SELECT * FROM spawn WHERE Name = '" + player.Name + "'");
  if(!q)
  {
   QuerySQL(locs, "INSERT INTO spawn ( Autospawn, xaxis, yaxis, zaxis, Name ) VALUES ( 'true' , '" + player.Pos.x + "' , '" + player.Pos.y + "' , '" + player.Pos.z + "', '" + player.Name + "' ) ");
  }
  else
  {
   QuerySQL(locs, "UPDATE spawn SET xaxis = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
   QuerySQL(locs, "UPDATE spawn SET yaxis = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
   QuerySQL(locs, "UPDATE spawn SET zaxis = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
   QuerySQL(locs, "UPDATE spawn SET Autospawn = 'true' WHERE Name = '" + player.Name + "'");
   ::PM("You are going to spawn here."+azul+" To disable it,"+blanco+" use /spawnloc", player);
}
}
}
else ::SMS( EROS + cmd + " <on/off/set>", player );
}
}


function onPlayerSpawn(player)
(click to show/hide)
local q = QuerySQL(locs, "SELECT * FROM spawn WHERE Name = '" + player.Name + "'");
 if( q && GetSQLColumnData(q, 0) == "true" )
 {
  local
  xspawn = GetSQLColumnData(q, 1).tointeger(),
  yspawn = GetSQLColumnData(q, 2).tointeger(),
  zspawn = GetSQLColumnData(q, 3).tointeger();

  player.Pos = Vector(xspawn, yspawn, zspawn);
 }
7
Bug Reports / lan problem
« on November 11th, 2018, 07:34 AM »
there is a big problem with lan servers, can not add it normally just appear normal server from the internet list


and in the favorite servers appears without name is something wrong with this :(
8
Support / PlayerClass and SQLQuery problem
« on November 11th, 2018, 04:55 AM »
so, my problem is the next one, blank server.
i already maked my playerclass,
and did my first class to try it



but my playerclass is not recognized




same happened with my SQLQuery isn't recognized what can i do??
function tablescreator()
{
QuerySQL( db, blah blah)");
}