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 - KrOoB_

#1
Tutorials / [LiveMap] Server to Website
Jan 13, 2021, 12:29 PM
Vice City LiveMap

Website
Install XAMPP
You need a website so you have to install XAMPP

[After Installation]
Download this and extract to X:\xampp\htdocs\ (delete everything in htdocs before)

VC:MP
Download this plugin(json) and move it to plugins folder then add the plugin's name to server.cfg
After that place this code to your main.nut (you can add more features)
function onScriptLoad()
{
  NewTimer("LiveMap", 1000, 0);
}

function LiveMap()
{
   local i = 0, ii = 0, plrveh = null, plrspec = null;
    local players = [];
    if (GetPlayers() > 0) {
        while ((i < GetMaxPlayers()) && (ii < GetPlayers())) {
            local plr = FindPlayer(i++);
            if (!plr) continue;

            if (plr.Vehicle) plrveh = {
                model = plr.Vehicle.Model,
                color = [plr.Vehicle.Colour1, plr.Vehicle.Colour2],
                health = plr.Vehicle.Health
            }
            else plrveh = null;

            players.push({
                id = plr.ID,
                name = plr.Name,
                skin = plr.Skin,
                team = plr.Team,
                hp = plr.Health,
                ap = plr.Armour,
                score = plr.Score,
                cash = plr.Cash,
                ping = plr.Ping,
                weapon = plr.Weapon,
                vehicle = plrveh,
                pos = {
                    x = plr.Pos.x,
                    y = plr.Pos.y
                },
                spawned = plr.IsSpawned,
                spectating = plrspec
            });
            ii++;
        }
    }
    local export = {
        hostname = GetServerName(),
        weather = GetWeather(),
        hour = GetHour(),
        minute = GetMinute(),
        numplayers = GetPlayers(),
        maxplayers = GetMaxPlayers(),
        players = players
    }

    try {
        toJSONFile("C:/xampp/htdocs/data.json", export, JSON_C_TO_STRING_PRETTY);
    }
    catch (e) {
        print("Export failed: " + e);
    }

}

Start the server and open your website
CREDITS
huncrys (Kristóf Bach)
Gudio
Their github link
#2
Object Showroom / Front Page Cafe
Jan 10, 2021, 05:20 PM
Content Type: Map/Object
Original Author: Vice City
Modifications: Extracted from VC files and fixed
Modified by: KrOoB_ and ressam
Link: Normal/Large
Screenshots:


#3
Better cuff system

Credits: KrOoB_

SERVER
[noae]
class Playerstatus
{
 InJail = "false";
 JailFor = null;
 Skor = 0;
 crim = false;
 breaks = false;
}

function onScriptLoad()
{
status <- array(GetMaxPlayers(), null);
}

function onPlayerJoin( player )
{
status[player.ID] = Playerstatus();
}

function tutukla( player, plr )
{
    local player = FindPlayer(player);
    local plr = FindPlayer(plr);
    if (plr.Score > 0)
{
if( status[plr.ID].breaks == true)
{
plr.IsFrozen = false;
status[plr.ID].breaks = false;
Message("[#ac9000][VCPD] [#FFFFFF]WTF he just escaped");
Stream.StartWrite();
Stream.WriteInt(40);
Stream.SendStream(plr);
}else{
                    if(plr.Vehicle)
                        {
                            plr.Eject();
                            plr.Pos = player.Pos;
                            plr.IsFrozen = true;
                            plr.SetAnim(0,162);
                            MessagePlayer("[#ac9000][VCPD] [#FFffff]Can't escape from VCPD",plr);
                            MessagePlayer("[#ac9000][VCPD] [#FFffff]That was funny, do not try again!!",player);
                        }
                        else {
plr.Health = 100;
plr.Pos = Vector(390.863, -508.094, 9);
local Value = plr.Score; // if i write here 1 then player(criminal) stays 1 min in jail
if (Value > 6) Value = 6;
local reward = Value * 5, RealJailTime = Value * 60;
MessagePlayer("[#ac9000][VCPD] [#ffffff]Police Officer " + player.Name + " just arrest you!", plr);
                        MessagePlayer("[#ac9000][VCPD][#ffffff]Got Medical attention", plr);
Message("[#ac9000][VCPD] [#FFFFFF]Police Officer " + player.Name + " just arrest a criminal named " + plr.Name + " . Duration:" + Value + " Min");
IncCash(player, reward); // u can find this function in forum
plr.Skin = 7;
plr.Disarm();
status[ plr.ID ].JailFor = RealJailTime;
Stream.StartWrite( );
Stream.WriteInt( 33 );
Stream.SendStream( plr );
                        if(plr.IsFrozen == true) plr.IsFrozen = false;
Stream.StartWrite();
Stream.WriteInt(40);
Stream.SendStream(player);                       
}
        }
}
}

function onTimeChange(oldHour, oldMin, newHour, newMin)
{
for (local i = 0; i < GetMaxPlayers(); ++i)
{
local player = FindPlayer(i);

if (player)
{
if (player.IsSpawned)
{
if ( status[player.ID].JailFor != null )
{
if (status[player.ID].InJail == "true" && status[player.ID].JailFor > 0)
{
local Time = status[player.ID].JailFor,
mins = (Time % 3600) / 60,
secs = Time % 60;
Stream.StartWrite();
Stream.WriteInt(35);
Stream.WriteString(mins + ":" + secs);
Stream.SendStream(player);
status[player.ID].JailFor--;
local polyarest;
polyarest = InPoly( player.Pos.x, player.Pos.y, 411.836, -482.679, 286.270, -467.721, 350.046, -482.532, 391.226, -522.587);
if( !polyarest && status[player.ID].InJail == "true" ) player.Pos = Vector(390.863, -508.094, 9);
}
else if (status[player.ID].JailFor < 1)
{
Stream.StartWrite();
Stream.WriteInt(34);
Stream.SendStream(player);
                        player.Score = 0;
                       
}
}
}
        }
    }
}
 function onPlayerCommand( player, cmd, text )
{
if (cmd == "tutukla" || cmd == "t")
{
if (!text) MessagePlayer("Error - /" + cmd + " [Name/id]", player);
else
{
local plr = text != "" ? IsNum(text) ? FindPlayer(text.tointeger()) : FindPlayer(text) : player;
if (!plr) MessagePlayer("[#ac9000][VCPD] Unkown Player", player);
else if (status[plr.ID].InJail == "true") MessagePlayer("[#ac9000][VCPD] He's already in jail bruh", player)
else if (plr.Name == player.Name) MessagePlayer("[#ac9000][VCPD] Trying to cuff himself kekW", player)
else if (DistanceFromPoint(player.Pos.x, player.Pos.y, plr.Pos.x, plr.Pos.y) < 2)
{
      status[plr.ID].crim = true;
                      Stream.StartWrite();
Stream.WriteInt(38);
Stream.SendStream(plr);
                        plr.IsFrozen = true;
                        hapiss <- NewTimer("tutukla",5000,1,player.ID,plr.ID);

}
else MessagePlayer("[#ac9000][VCPD] [#FFFFFF]Away",player)
}
}
}
function onClientScriptData( player )
{
local int = Stream.ReadInt( ),
string = Stream.ReadString ( );
  switch( int.tointeger() )
{
case 3:
if( status[player.ID].breaks == false)
{
status[player.ID].breaks = true;
}
break;
}
}

[/noae]

CLIENT
[noae]ask<-KeyBind(0x4B);

Cuff<-
{
    Window = null
    tBar = null
    stat = 0
}


function Server::ServerData(stream)
{
 local StreamReadInt = stream.ReadInt(),
 StreamReadString = stream.ReadString();
 switch (StreamReadInt.tointeger())
 {
case 38: Criminal( ); break;
case 40: DeCrim(); break;
 }
}

function KeyBind::OnDown( key )
{
if( key == ask)
{
if ( Cuff.Window)
{
if ( Cuff.stat > 0)
{
if ( Cuff.tBar.Value == 6 || Cuff.tBar.Value == 7 || Cuff.tBar.Value == 8 || Cuff.tBar.Value == 9 || Cuff.tBar.Value == 10 )
{
local Data = Stream();
Data.WriteInt(3);
Server.SendData(Data);
}else
  {
Cuff.Window = null;
Cuff.tBar = null;
Cuff.stat = 0;
Console.Print("[#FFFFFF]Unsuccessful");
  }
}
}
}
}

// bad code sorry  :(
function Script::ScriptProcess( )
{
if (Cuff.Window)
{
if( Cuff.stat == 1 )
{
Cuff.tBar.Value += 1;
}
else if ( Cuff.tBar.Value == 15 )
{
Cuff.stat = 2;
}
else if( Cuff.stat == 2 )
{
Cuff.tBar.Value -= 1;
}
else if( Cuff.stat == 2 && Cuff.tBar.Value == 0 )
{
Cuff.stat = 1;
}
durduran <- Timer.Create( this, DeCrim, 2000, 1);
}
}

function Criminal( )
 {
    Cuff.Window = GUIWindow(VectorScreen(sX * 0.35, sY * 0.75), VectorScreen(sX * 0.4, sY * 0.123), Colour(20, 20, 20, 200), "DECUFF", GUI_FLAG_TEXT_TAGS);
    Cuff.Window.AddFlags(GUI_FLAG_VISIBLE);
    Cuff.Window.RemoveFlags(GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_CLOSEBTN | GUI_FLAG_WINDOW_RESIZABLE);

    Cuff.tBar = GUIProgressBar();
    Cuff.tBar.Pos = VectorScreen(sX * 0.005, sY * 0.0015);
    Cuff.tBar.Size = VectorScreen( sX * 0.39, sY * 0.064 );
    Cuff.tBar.StartColour = Colour( 40, 255, 40 );
    Cuff.tBar.EndColour = Colour( 180, 110, 110 );
    Cuff.tBar.MaxValue = 15;
    Cuff.tBar.Value = 0;
    Cuff.tBar.BackgroundShade = 0.3;
    Cuff.tBar.Thickness = 2;
    Cuff.stat = 1;
    Cuff.Window.AddChild(Cuff.tBar);
 }

 function DeCrim()
{
Cuff.Window = null;
Cuff.tBar = null;
Cuff.stat = 0;
}
[/noae]

#4
Vehicle Showroom / Fixed McLaren
Oct 01, 2020, 09:44 PM
Official Author and Link: Jarone
Modifications: There was a collision bug 'til this day :D
Modified By: KrOoB_

File:
https://www92.zippyshare.com/v/LZUgkfJs/file.html
#5
Snippet Showroom / Need some Nos ?
Oct 01, 2020, 09:30 PM
INFORMATION
It's a basic nos script :D

Credits
KrOoB_

Code
class nos{
basili = false;
sure = 10; // nos amount/second
durum = false;
}

function onScriptLoad()
{
turbo <- array(GetMaxPlayers(), null);
CTRL <- BindKey(true, 0x11, 0, 0);
}



// u can use timers if u wish
function onTimeChange(oldHour, oldMin, newHour, newMin)
{
for (local i = 0; i < GetMaxPlayers(); ++i)
{
local player = FindPlayer(i);
if (player)
{
if (player.IsSpawned)
{
if ( turbo[ player.ID ].basili == true)
{
if ( turbo[ player.ID ].durum == true)
{
if ( turbo[ player.ID ].sure > 0 )
{
turbo[ player.ID ].sure -= 1;
}else {
local veh = player.Vehicle;
turbo[ player.ID ].sure = 0;
veh.ResetHandlingData(13);
veh.ResetHandlingData(14);
MessagePlayer("Vehicle's nos tube is empty get a new one",player);
}
}
}
}
}
}
}



function onKeyDown( player, key )
{
if ( key == CTRL )
{
if ( player.Vehicle )
{
turbo[ player.ID ].basili = true;
if ( turbo[ player.ID ].sure > 0 )
{
local veh = player.Vehicle;
veh.Lights = true;
turbo[ player.ID ].durum = true;
veh.SetHandlingData(14, 100)
veh.SetHandlingData(13, 1000)
}else return MessagePlayer("Empty",player);
}
}
}

function onKeyUp( player, key )
{
if ( key == CTRL )
{
if ( player.Vehicle )
{
local veh = player.Vehicle;
veh.Lights = false;
turbo[ player.ID ].basili = false;
veh.ResetHandlingData(13);
veh.ResetHandlingData(14);
}
}
}
#6
Snippet Showroom / No need to die
Sep 30, 2020, 06:53 PM
INFORMATION
Normally when a player dies game sends player to character selection part, with this script there'll no character selection.
When a player dies script'll freeze and sets hp to 1, script waits 1 min for doctors (i add a function for doctors u can use it, named kaldir) (After 1 min script sends player to nearest hospital)

Credits
 KrOoB_ and Bob
(this script works with bob's script add it too)
Thanks Bob, Send Player to Nearest Hospital

Server Side
[noae][noae][noae][noae]class Playerstatus
{
 Died = false;
 d_X = null;
 d_Y = null;
 d_Z = null;
 DeadFor = null;
}


function onScriptLoad()
{
    acilarr <- array(GetMaxPlayers(), false);

status <- array(GetMaxPlayers(), null)
// You can edit SQL code it's just an example
        DB <- ConnectSQL("Databases/Hesap.db");
        QuerySQL(DB, "create table if not exists Other ( Name TEXT, Died BOOLEAN DEFAULT false, DX FLOAT, DY FLOAT, DZ FLOAT) ");
}

function onPlayerJoin( player )
{
status[player.ID] = Playerstatus();
DeadInfo(player);
}

function aciloff(player)
{
    player = FindPlayer( player );
    DestroyMarker( acils );
    acilarr[player.ID] = false;
}

function DeadInfo(player)
{
 local z = QuerySQL(DB, "SELECT * FROM Other WHERE Name = '" + escapeSQLString(player.Name) + "'");
 if (q)
 {
  status[player.ID].Died = GetSQLColumnData(z, 7);
  status[player.ID].d_X = GetSQLColumnData(z, 8);
  status[player.ID].d_Y = GetSQLColumnData(z, 9);
  status[player.ID].d_Z = GetSQLColumnData(z, 10);
 }
}
function onPlayerDeath( player, reason )
{
        player.Health = 1;
        status[player.ID].d_X = player.Pos.x;
        status[player.ID].d_Y = player.Pos.y;
        status[player.ID].d_Z = player.Pos.z;   
        status[player.ID].Died = true;

if ( status[player.ID].Died == true)
{
            // Emergency Call

 local acilci;
 for( local i = 0; i <= GetMaxPlayers(); i++ )
 {
 acilci = FindPlayer( i );
 if ( (acilci) && ( acilci.Skin == 1 ) )
 {
                Message("[#1b8bb4][EMERGENCY] [#FFFFFF]" + player.Name + " [#1b8bb4] needs medical attention. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"")
                MessagePlayer("[#1b8bb4][EMERGENCY] [#FFFFFF]Doctors are called. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"",player)   
     acils <- CreateMarker(1, Vector(player.Pos.x, player.Pos.y, player.Pos.z), 1, RGB(0, 255, 0), 22)
    NewTimer("aciloff", 30000, 1, player.ID);
    acilarr[player.ID] = true;
 }
    }
        player.SetAnim(0,126);
        player.IsFrozen = true;
    }
}

function onPlayerKill( killer, player, reason, bodypart )
{
    player.Health = 1;
    status[player.ID].Died = true;
    if ( status[player.ID].Died == true)
    {
            // Emergency Call
local acilci;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
acilci = FindPlayer( i );
if ( (acilci) && ( acilci.Skin == 1 ) )
{
                Message("[#1b8bb4][EMERGENCY] [#FFFFFF]" + player.Name + " [#1b8bb4] needs medical attention. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"")
                MessagePlayer("[#1b8bb4][EMERGENCY] [#FFFFFF]Doctors are called. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"",player)   
acils <- CreateMarker(1, Vector(player.Pos.x, player.Pos.y, player.Pos.z), 1, RGB(0, 255, 0), 22)
NewTimer("aciloff", 30000, 1, player.ID);
acilarr[player.ID] = true;
}
}
        player.SetAnim(0,126);
        player.IsFrozen = true;
    }
}

function onTimeChange(oldHour, oldMin, newHour, newMin)
{
for (local i = 0; i < GetMaxPlayers(); ++i)
{
local player = FindPlayer(i);

if (player)
{
if (player.IsSpawned)
{
            if ( status[player.ID].Died == true)
            {
                if (status[player.ID].DeadFor == null)
                {
                    // Calculating time
                        local Val = 1;
                        local DeadJail = Val * 10000, DeadJail2 = Val * 10;
                        status[player.ID].DeadFor = DeadJail2;
                }else {

                    local Time = status[player.ID].DeadFor,
mins = (Time % 3600) / 60,
secs = Time % 60;
Stream.StartWrite();
Stream.WriteInt(36);
Stream.WriteString(mins + ":" + secs);
Stream.SendStream(player);
status[player.ID].DeadFor--;
                }
if ( status[player.ID].DeadFor < 1)
{
if( Hospi[player.ID] == 1 )
{
GetNearestHospital(player);
player.World = 1;
                            // En yakın Hastane Scripti entegresi adamın süresi dolunca en yakın hastaneye gider
if (Hospital_Spawn[player.ID] == true) { player.Pos = Hospital_Locator[player.ID]; Hospital_Spawn[player.ID] = false; }
Hospi[player.ID] = 0;
MessagePlayer( "[#e74c3c][EMERGENCY] [#FFFFFF]Revived.", player );
Stream.StartWrite();
Stream.WriteInt(37);
Stream.SendStream(player);
status[player.ID].DeadFor = null;
status[player.ID].Died = false;
player.IsFrozen = false;
player.SetAnim(0,172);
}
    }
                }
            }
        }
    }
}
function onPlayerSpawn( player )
{
    if ( status[player.ID].Died == true)
    {
Hospi[player.ID] = 1;
        player.SetAnim(0,126);
        player.IsFrozen = true;
        player.Pos = Vector(status[player.ID].d_X,status[player.ID].d_Y,status[player.ID].d_Z);
        // i'm saving player's pos cause of dead bug like explode etc.
        // if player's death cause is explode, game sends player directly character selection
        local acilci;
        for( local i = 0; i <= GetMaxPlayers(); i++ )
        {
            acilci = FindPlayer( i );
            if ( (acilci) && ( acilci.Skin == 1 ) )
            {
                Message("[#1b8bb4][EMERGENCY] [#FFFFFF]" + player.Name + " [#1b8bb4] needs medical attention. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"")
                MessagePlayer("[#1b8bb4][EMERGENCY] [#FFFFFF]Doctors are called. [#1b8bb4] Position:[#FFFFFF] " +GetDistrictName(player.Pos.x, player.Pos.y)+"",player)   
                acils <- CreateMarker(1, Vector(player.Pos.x, player.Pos.y, player.Pos.z), 1, RGB(0, 255, 0), 22)
                NewTimer("aciloff", 30000, 1, player.ID);
                acilarr[player.ID] = true;
            }
        }
    }
}

// function for doctors' command to revive dead/injured player
function kaldir( p )
{

 local player = FindPlayer( p );
 if( player )
    {
        player.IsFrozen = false;
        player.SetAnim(0,161);
        status[player.ID].Died = "false";
        MessagePlayer("[#ef5777]#[#0be881]VC[#d2dae2]-[#575fcf]TR[#ef5777]# [#828282]Tedavin bitti", player);
    }
Stream.StartWrite();
Stream.WriteInt(37);
Stream.SendStream(player);
status[player.ID].DeadFor = null;
}
function SaveAccount(player)
{
          QuerySQL(DB, "UPDATE Other SET Died = '" + status[player.ID].Died + "' WHERE Name = '" + player.Name + "'");
          QuerySQL(DB, "UPDATE Other SET DX = '" + status[player.ID].d_X + "' WHERE Name = '" + player.Name + "'");
          QuerySQL(DB, "UPDATE Other SET DY = '" + status[player.ID].d_Y + "' WHERE Name = '" + player.Name + "'");
          QuerySQL(DB, "UPDATE Other SET DZ = '" + status[player.ID].d_Z + "' WHERE Name = '" + player.Name + "'");
}


[/noae][/noae][/noae][/noae]
Client Side
[noae][noae][noae][noae]
Dead <-
    {
    Windows = null
    Labels = null
        Time = null
    }

function Server::ServerData(stream)
{
 local StreamReadInt = stream.ReadInt(),
 StreamReadString = stream.ReadString();
 switch (StreamReadInt.tointeger())
 {
case 36: local data = StreamReadString; DeadFors(data); break;
case 37: Dead.Labels = null; break;
 }
 }

  function DeadFors(data)
    {
    local separator = split(data ":"), mins = separator[0], secs = separator[1];
    Dead.Labels = GUILabel(VectorScreen(sX * 0.5, sY * 0.8), Colour(232, 232, 232), "", GUI_FLAG_TEXT_SHADOW | GUI_FFLAG_BOLD);
Dead.Labels.FontSize = 15;
    Dead.Labels.Text = "" + mins + " min " + secs + " sec";
    }
function DeadForN()
    {
    Dead.Labels = null;
    }

[/noae][/noae][/noae][/noae]
VIDEO
Note: I'm using it in my server no bug or error.(while extracting from server script i might be miss something, just in case u can tell thanks) 
#7

There is no collision but i can't walk around why?


files
https://dosya.co/hlt5vd7mgfff/cafe.7z.html
#8
links are working also no problem in index but it's getting error while requesting why?

#9
i tried to hide this object from map but i couldn't why ? (i can hide other map objects)
code;     HideMapObject(1815,-637.278, 834.331, 12.4208)SS
#10
Script Showroom / Let's Rob Some Bank ?
Jul 19, 2020, 12:09 PM
It's a rob script with a little game :D I just think that while robing a bank or somewhere else it's kind a boring because we're doing nothing so i add a little something like a game good luck <3 ;D


If you see bugs or error please notice ( tried 3 times )

Thanks to ysc3839 for Timers <3


Server Side

[noae][noae]function onScriptLoad()
{
Rob <- array( GetMaxPlayers(), true);
  teleport <- array(GetMaxPlayers(),0);
   BankRob <- CreateCheckpoint(null, 0, true, Vector(-942.61, -343.512, 7.22693), RGB(255, 0, 200), 2.0);
CreateCheckpoint(null, 0, true, Vector(-939.282, -351.561, 7.22692), RGB(0, 0, 200), 1.0);
  CreateCheckpoint(null, 0, true, Vector( -938.388, -351.363, 17.8038), RGB(0, 0, 200), 2.0);

VK_LEFT <- BindKey(true, 0x25, 0, 0);
VK_RIGHT <- BindKey(true, 0x27, 0, 0);
VK_UP <- BindKey(true, 0x26, 0, 0);
VK_DOWN <- BindKey(true, 0x28, 0, 0);
ENTER <- BindKey(true, 0x0D, 0, 0);
I_KEY <- BindKey(true, 0x49, 0, 0);
}

function onClientScriptData( player )
{
  local int = Stream.ReadInt( ),
string = Stream.ReadString ( );
  switch( int )
{
case 1:
player.Cash += 10000;
Message("[#eeeeee]"+ player.Name +" has been robbed a bank, Last seen at "+ GetDistrictName( player.Pos.x, player.Pos.y ) +". All cops requested to arrest him!");
player.IsFrozen = false;
break;
case 2:
player.Cash += 1;
player.IsFrozen = false;
Message("[#eeeeee]"+ player.Name +" tried to rob a bank, Last seen at "+ GetDistrictName( player.Pos.x, player.Pos.y ) +". All cops requested to arrest him!");
}
}


function onCheckpointEntered( player, checkpoint )
{
teleport[player.ID] = checkpoint.ID;
teleport[player.ID] += 1;
print(teleport[player.ID]);
}

function onCheckpointExited( player, checkpoint )
{
teleport[player.ID] = 99;
}


function onKeyUp( player, key )
{
    if (key == ENTER)
    {
switch(teleport[player.ID])
{
case 1:
if ( Rob[player.ID] == true )
{
Stream.StartWrite( );
Stream.WriteInt( 10 );
Stream.SendStream( player );
Rob[player.ID] = false;
player.IsFrozen = true;
local check = FindCheckpoint(0);
check.Remove();
}else
{
Message("You can't rob rn");
}
break;
case 2:
                    player.Pos = Vector(-939.282, -351.561, 17.22692);
break;
case 3:
                    player.Pos = Vector(-938.388, -351.363, 7.8038);
break;
}
}
if ( key == VK_LEFT)
{
    Stream.StartWrite()
  Stream.WriteInt(2)
  Stream.WriteString("left")
  Stream.SendStream(player)
}
if ( key == VK_RIGHT)
{
    Stream.StartWrite()
  Stream.WriteInt(2)
  Stream.WriteString("right")
  Stream.SendStream(player)
}
if ( key == VK_UP)
{
    Stream.StartWrite()
  Stream.WriteInt(2)
  Stream.WriteString("upper")
  Stream.SendStream(player)
}
if ( key == VK_DOWN)
{
    Stream.StartWrite()
  Stream.WriteInt(2)
  Stream.WriteString("down")
  Stream.SendStream(player)
}
}

[/noae][/noae]


Client Side
[noae][noae]
Timer <- {
 Timers = {}

 function Create(environment, listener, interval, repeat, ...)
 {
 // Prepare the arguments pack
 vargv.insert(0, environment);

 // Store timer information into a table
 local TimerInfo = {
 Environment = environment,
 Listener = listener,
 Interval = interval,
 Repeat = repeat,
 Args = vargv,
 LastCall = Script.GetTicks(),
 CallCount = 0
 };

 local hash = split(TimerInfo.tostring(), ":")[1].slice(3, -1).tointeger(16);

 // Store the timer information
 Timers.rawset(hash, TimerInfo);

 // Return the hash that identifies this timer
 return hash;
 }

 function Destroy(hash)
 {
 // See if the specified timer exists
 if (Timers.rawin(hash))
 {
 // Remove the timer information
 Timers.rawdelete(hash);
 }
 }

 function Exists(hash)
 {
 // See if the specified timer exists
 return Timers.rawin(hash);
 }

 function Fetch(hash)
 {
 // Return the timer information
 return Timers.rawget(hash);
 }

 function Clear()
 {
 // Clear existing timers
 Timers.clear();
 }

 function Process()
 {
 local CurrTime = Script.GetTicks();
 foreach (hash, tm in Timers)
 {
 if (tm != null)
 {
 if (CurrTime - tm.LastCall >= tm.Interval)
 {
 tm.CallCount++;
 tm.LastCall = CurrTime;

 tm.Listener.pacall(tm.Args);

 if (tm.Repeat != 0 && tm.CallCount >= tm.Repeat)
 Timers.rawdelete(hash);
 }
 }
 }
 }
};

sX <- GUI.GetScreenSize().X;
sY <- GUI.GetScreenSize().Y;

    Robbery<-
    {
    Window = null
    tBar = null
        times = 0
    }

ScreenS <-
{
    sprite = null
}
 keys <-
 {
     stat = false
 }   

      alt <- false;
     upper <- false;
     right <- false;
     left <- false;
     tus <- null;
     keyf <- null;

   gmode <- ["right", "left", "down", "upper"]
//-------------------------------------------------------------------


function rander()
{   
    ::keyf = gmode[rand()% gmode.len()];
    if( keys.stat == false )
    {
    ::tus = null;
    Timer.Create( this, verifa, 1000, 1 );
    Sprites <- Timer.Create( this, KeySprites, 0.1, 1 );
    }
}

function KeySprites()
{
    if ( ::keyf == "down" )
    {
 ScreenS.sprite <- GUISprite("assagi.png", VectorScreen(sX * 0.30, sY * 0.30));
  ScreenS.sprite.Size = VectorScreen(250, 250);
  }
    if ( ::keyf == "upper" )
    {
 ScreenS.sprite <- GUISprite("yukari.png", VectorScreen(sX * 0.30, sY * 0.30));
  ScreenS.sprite.Size = VectorScreen(250, 250);
  }
      if ( ::keyf == "left" )
    {
 ScreenS.sprite <- GUISprite("sol.png", VectorScreen(sX * 0.30, sY * 0.30));
  ScreenS.sprite.Size = VectorScreen(250, 250);
  }
      if ( ::keyf == "right" )
    {
 ScreenS.sprite <- GUISprite("sag.png", VectorScreen(sX * 0.30, sY * 0.30));
  ScreenS.sprite.Size = VectorScreen(250, 250);
  }
}

function verifa()
{
    if( keyf == ::tus)
    {
        keys.stat = false;
        ScreenS.sprite = null;
    }else
    {
        Robbery.times += 1;
        Robbery.tBar.Value -= 5 * Robbery.times;
        keys.stat = false;
        ScreenS.sprite = null;
    }
}

function Script::ScriptProcess()
{
    Timer.Process();
}

function Server::ServerData( stream )
{
 local StreamReadInt = stream.ReadInt(),
  StreamReadString = stream.ReadString();
 switch (StreamReadInt.tointeger())
 {
                case 2: local data = StreamReadString; if ( StreamReadString ){ ::tus = StreamReadString; } break;
          case 10: Criminal( ); break;
     default: break;
 }
}

function Criminal( )
{
    Robbery.Window = GUIWindow(VectorScreen(sX * 0.35, sY * 0.75), VectorScreen(sX * 0.4, sY * 0.123), Colour(20, 20, 20, 200), "HAK YEDIN HACK YICEKSIN YAKINDA", GUI_FLAG_TEXT_TAGS);
    Robbery.Window.AddFlags(GUI_FLAG_VISIBLE);
    Robbery.Window.RemoveFlags(GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_CLOSEBTN | GUI_FLAG_WINDOW_RESIZABLE);

         Robbery.tBar = GUIProgressBar();
 Robbery.tBar.Pos = VectorScreen(sX * 0.005, sY * 0.0015);
 Robbery.tBar.Size = VectorScreen( sX * 0.39, sY * 0.064 );
 Robbery.tBar.StartColour = Colour( 40, 255, 40 );
 Robbery.tBar.EndColour = Colour( 180, 110, 110 );
 Robbery.tBar.MaxValue = 100;
  Robbery.tBar.Value = 0;
 Robbery.tBar.BackgroundShade = 0.3;
 Robbery.tBar.Thickness = 2;
  Robbery.Window.AddChild(Robbery.tBar);
        Ilerleme <- Timer.Create( this, progressing, 2000, 21 );
        Sallama <- Timer.Create( this, rander, 5000, 8 );
        Check <- Timer.Create( this, Checking, 43000, 1 );
}

function progressing()
{

Robbery.tBar.Value += 5;
Conlefte.Print(Robbery.tBar.Value);
 
}
function Checking()
{
    if ( Robbery.tBar.Value >= 100 )
    {
        ScreenS.sprite = null;
        Timer.Destroy( Ilerleme );
        Timer.Destroy( Sallama );
        Robbery.Window = null;
        local Datas = Stream();
Datas.WriteInt(1);
Server.SendData(Datas);
    }
    if ( Robbery.tBar.Value < 100 )
    {
        Timer.Destroy( Ilerleme );
        Timer.Destroy( Sallama );
        Robbery.Window = null;
        local Datas = Stream();
    Datas.WriteInt(2);
Server.SendData(Datas);       
    }
}
function GUI::GameResize( width, height )
{
        if (Robbery.Window)
    {
    Robbery.Window.Pos = VectorScreen(sX * 0.35, sY * 0.75);
    Robbery.Window.Size = VectorScreen(sX * 0.4, sY * 0.123);

    Robbery.tBar.Pos = VectorScreen(sX * 0.005, sY * 0.0015);
    Robbery.tBar.Size = VectorScreen(sX * 0.39, sY * 0.064);
    }
}

seterrorhandler(errorHandling);
[/noae][/noae]
#11
Script Showroom / Basic Tunning System w/GUI
Jul 18, 2020, 03:23 AM
While making this script i use KrLozz Vehicle System so they are compatible 100% (0 error).
and thanks NewK for help
You can use your own vehicle script it'll compatible with yours no problem :D ( if you get error please notice me)

INFO
First things first script create a table in db because it needs to store somewhere :D
then getting handling infos from car after this it writing to database.
Finally, player enter vehicle and trigger the function, function starts load the vehicles info's from database and done :THUMSUP: :D

I made it at night so there maybe error( i saw nothing tried 2 times ) please notice me good luck <3

WARNINGS

I'm not a designer don't judge me about pic and hud i'm learning still :D

The tunning packs are randomly set i just write numbers so car can be too crazy or just freeze the car :D


İf you are using krlozz's script or another and you have already vehicle database just add this code your server and start just one time it'll create a table and add vehicles you have in your db
[noae][noae][noae][noae][noae][noae]function onScriptLoad()
{
LoadTunning();
}

function LoadTunning()
{
local q = QuerySQL( Vehicles, "SELECT * FROM Creation" ), i = 0;
while( GetSQLColumnData( q, 0 ) )
{
local Model= GetSQLColumnData( q, 1 );
QuerySQL( Vehicles, "INSERT INTO Tunning ( ID, Acceleration, MaxSpeed, NumberGears, Flags ) VALUES ( '" + GetSQLColumnData( q, 0 ) + "','" + GetHandlingRule( GetSQLColumnData( q, 1 ), 14) + "','" + GetHandlingRule(GetSQLColumnData( q, 1 ), 13) + "', '" + GetHandlingRule(GetSQLColumnData( q, 1 ), 12) + "', '" + GetHandlingRule(GetSQLColumnData( q, 1 ), 28) + "' )" );
GetSQLNextRow( q );
i++;
}
print("Writen ("+i+")");
return 0;
}
[/noae][/noae][/noae][/noae][/noae][/noae]

I'm not a designer don't judge me about pic and hud i'm learning still :D



https://www.youtube.com/watch?v=HKOaJ02hXPA


Server Side

[noae][noae][noae][noae][noae][noae]function onScriptLoad()
{
I_KEY <- BindKey(true, 0x49, 0, 0);
      ENTER <- BindKey(true, 0x0D, 0, 0);
    teleport <- array(GetMaxPlayers(),0);
  Customer <- CreateCheckpoint(null, 0, true, Vector(-846.449, -902.177, 11.1034), RGB(0, 0, 200), 3.0);
  Marker_Customer <- CreateMarker(0, Vector( -846.449, -902.177, 11.1034 ), 2, RGB(41, 182, 0), 20 );


//KrLoz script's db
Vehicles <- ConnectSQL( "scripts/Vehicles.db" );

QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Creation ( id NUMERIC, model NUMERIC, x NUMERIC, y NUMERIC, z NUMERIC, col1 NUMERIC, col2 NUMERIC, world NUMERIC, angle NUMERIC)" );
QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Sale ( ID NUMERIC, Cost NUMERIC, Owner TEXT, Shared TEXT, Shared2 TEXT )" );
LoadVehicles();

 QuerySQL(Vehicles, "create table if not exists Tunning ( ID NUMERIC, Acceleration FLOAT, MaxSpeed FLOAT, NumberGears NUMERIC, Flags Numeric ) ");
 tuni <- array(GetMaxPlayers(), null);

}

function onScriptUnload()
{
}
function LoadVehicles()
{
local q = QuerySQL( Vehicles, "SELECT * FROM Creation" ), i = 0;
while( GetSQLColumnData( q, 0 ) )
{
local
Model= GetSQLColumnData( q, 1 ),
X= GetSQLColumnData( q, 2 ),
Y= GetSQLColumnData( q, 3 ),
Z= GetSQLColumnData( q, 4 ),
Col1= GetSQLColumnData( q, 5 ),
Col2= GetSQLColumnData( q, 6 ),
World= GetSQLColumnData( q, 7 ),
Angle= GetSQLColumnData( q, 8 );
CreateVehicle( Model, World, Vector(X, Y, Z), Angle, Col1, Col2 );
GetSQLNextRow( q );
i++;
}
print("Vehicles Count ("+i+")");
return 0;
}

// ========================================== V E H I C L E   E V E N T S =============================================

function onPlayerEnterVehicle( player, vehicle, door )
{
local veh = player.Vehicle;

local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + vehicle.ID + "'");
 if (q)
 {
 veh.SetHandlingData(14, GetSQLColumnData(q, 1));
 veh.SetHandlingData(13, GetSQLColumnData(q, 2));
 veh.SetHandlingData(12, GetSQLColumnData(q, 3));
 veh.SetHandlingData(28, GetSQLColumnData(q, 4));
 }else
 {
local veh = vehicle.ID;
QuerySQL( Vehicles, "INSERT INTO Tunning ( ID, Acceleration, MaxSpeed, NumberGears, Flags ) VALUES ( '" + veh + "','" + GetHandlingRule( vehicle.Model, 14) + "','" + GetHandlingRule(vehicle.Model, 13) + "', '" + GetHandlingRule(vehicle.Model, 12) + "', '" + GetHandlingRule(vehicle.Model, 28) + "' )" );
 }
}

function IsVehForSale( id )
{
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+id+"'" );
local own = GetSQLColumnData( q, 2 );
if ( own == "Unowned" ) return 1;
else return 0;
}
function IsOwnerOrSharer( veh, player )
{
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
local owner = GetSQLColumnData( q, 2 );
local sha = GetSQLColumnData( q, 3 );
local sha2 = GetSQLColumnData( q, 4 );
if ( ( owner == player.Name ) || ( sha == player.Name ) || ( sha2 == player.Name ) ) return 1;
else return 0;
}
function IsVehicleOwner( veh, player )
{
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
local owner = GetSQLColumnData( q, 2 );
if ( owner == player.Name ) return 1;
else return 0;
}

//================================= O T H E R F U N C T I O N S ==========================================================

function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
tokenized = split(string, separator),
text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}

function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}

function GetPlayer( plr )
{
if ( plr )
{
if ( IsNum( plr ) )
{
plr = FindPlayer( plr.tointeger() );
if ( plr ) return plr;
else return false;
}
else
{
plr = FindPlayer( plr );
if ( plr ) return plr;
else return false;
}
}
else return false;
}
// =========================================== P I C K U P   E V E N T S ==============================================

// =========================================== P L A Y E R   E V E N T S ==============================================


function onPlayerCommand( player, cmd, text )
{
if ( cmd =="pos")
{
    Message( ""+ player.Pos.x + ", " + player.Pos.y + ", " + player.Pos.z);

}
else if ( cmd == "cag")
{
local veh = FindVehicle(1);
veh.Pos = Vector( player.Pos.x + 1, player.Pos.y+1, player.Pos.z  );

}
else if(cmd == "bring") {
if(!text) MessagePlayer( "Error - Correct syntax - /bring <Name/ID>' !",player );
else {
local plr = FindPlayer(text);
if(!plr) MessagePlayer( "Error - Unknown player !",player);
else {
plr.Pos = player.Pos;
MessagePlayer( "[ /" + cmd + " ] " + plr.Name + " was sent to " + player.Name, player );
}
}
}
   
/*
else if(cmd == "exec")
{
if( !text ) MessagePlayer( "Error - Syntax: /exec <Squirrel code>", player);
else
{
try
{
local script = compilestring( text );
script();
}
catch(e) MessagePlayer( "Error: " + e, player);
}
}
    */
   
return 1;
}

function onClientScriptData( player )
{
local int = Stream.ReadInt(),
string = Stream.ReadString();
Message(""+ string);
if(string == "r1")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
PlaySound(player.World, 50012, player.Pos);
veh.SetHandlingData(13, 1.0);
QuerySQL( Vehicles,"UPDATE Tunning SET Acceleration='"+ 10.0 +"' WHERE ID='"+player.Vehicle.ID+"'"); // 0.0 value is the new value of car's acceleration you need to change it with your values
QuerySQL( Vehicles,"UPDATE Tunning SET MaxSpeed='"+ 10.0 +"' WHERE ID='"+player.Vehicle.ID+"'");// 0.0 value is the new value of car's maxspeed you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
if(string == "motor2")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
veh.SetHandlingData(13, 0.0);
PlaySound(player.World, 50011, player.Pos);
QuerySQL( Vehicles,"UPDATE Tunning SET MaxSpeed='"+ 0.0 +"' WHERE ID='"+player.Vehicle.ID+"'");// 0.0 value is the new value of car's maxspeed you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
if(string == "motor3")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
veh.SetHandlingData(13, 0.0);
PlaySound(player.World, 50011, player.Pos);
QuerySQL( Vehicles,"UPDATE Tunning SET MaxSpeed='"+ 0.0 +"' WHERE ID='"+player.Vehicle.ID+"'"); // 0.0 value is the new value of car's maxspeed you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
if(string == "speed1")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
veh.SetHandlingData(14, 0.0);
PlaySound(player.World, 50011, player.Pos);
QuerySQL( Vehicles,"UPDATE Tunning SET Acceleration='"+ 0.0 +"' WHERE ID='"+player.Vehicle.ID+"'"); // 0.0 value is the new value of car's acceleration you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
if(string == "speed2")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
veh.SetHandlingData(14, 0.0);
PlaySound(player.World, 50011, player.Pos);
QuerySQL( Vehicles,"UPDATE Tunning SET Acceleration='"+ 0.0 +"' WHERE ID='"+player.Vehicle.ID+"'"); // 0.0 value is the new value of car's acceleration you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
if(string == "speed3")
{
if( player.Vehicle)
{
local veh = player.Vehicle;
local q = QuerySQL(Vehicles, "SELECT * FROM Tunning WHERE ID = '" + veh.ID + "'");
if (q)
{
veh.SetHandlingData(14, 0.0);
PlaySound(player.World, 50011, player.Pos);
QuerySQL( Vehicles,"UPDATE Tunning SET Acceleration='"+ 0.0 +"' WHERE ID='"+player.Vehicle.ID+"'"); // 0.0 value is the new value of car's acceleration you need to change it with your values
MessagePlayer("Vehicle successfully upgraded",player);
}
}else MessagePlayer("You need to be in a vehicle to do this", player)
  }
// After this, is yours you can add anything you want. for car Handling list http://wiki.thijn.ovh/index.php?title=Changing_Vehicle_Handling
}


// ====================================== C H E C K P O I N T   E V E N T S ==========================================

function onCheckpointEntered( player, checkpoint )
{
teleport[player.ID]=checkpoint.ID;
if ( teleport[player.ID] == 0)
{
Announce("Press I", player, 0);
}
}

function onCheckpointExited( player, checkpoint )
{
}

// =========================================== B I N D   E V E N T S =================================================

function onKeyUp( player, key )
{
  if (key == I_KEY)
    {
switch(teleport[player.ID])
{
case 0:
if( player.Vehicle)
{
local data = Stream();
data.StartWrite(  );
data.WriteInt(42);
Stream.SendStream(player)
}
break;
}
}
}

// ================================== E N D   OF   O F F I C I A L   E V E N T S ======================================


function SendDataToClient( player, ... )
{
    if( vargv[0] )
    {
        local     byte = vargv[0],
                len = vargv.len();
               
        if( 1 > len ) devprint( "ToClent <" + byte + "> No params specified." );
        else
        {
            Stream.StartWrite();
            Stream.WriteByte( byte );

            for( local i = 1; i < len; i++ )
            {
                switch( typeof( vargv[i] ) )
                {
                    case "integer": Stream.WriteInt( vargv[i] ); break;
                    case "string": Stream.WriteString( vargv[i] ); break;
                    case "float": Stream.WriteFloat( vargv[i] ); break;
                }
            }
           
            if( player == null ) Stream.SendStream( null );
            else if( typeof( player ) == "instance" ) Stream.SendStream( player );
            else devprint( "ToClient <" + byte + "> Player is not online." );
        }
    }
    else devprint( "ToClient: Even the byte wasn't specified..." );
}
[/noae][/noae][/noae][/noae][/noae][/noae]

Client Side

you need to download it Client Side and sound in this

I just spilled water on my desk f-ck,
see u guys <3

 :edit: Vehicles.db -  Example DB
#12
Script Showroom / Hot-Job Script
Jul 16, 2020, 07:51 AM
Don't mind the title, it's look cool :D whatever this script basically bank money delivery job system.
You can change marker/job path, anything.
this is my first rp job script and it's little messed up sorry for that: D
in future i'll do better than this
good luck O0

Let's watch some frame


Download
And there you go

Warn! I see 0 error but if you see tell me please :))
Test Server
80.253.245.58:8192
#13
Good morning again, i'm not a person who likes sleeping so i made this system good luck :)
(you can change item icons/you can add more items and easy to connect login/register systems)
Click go brr

Some pictures (just one :D)



HUD file for designers :D  HUD1.psd
(Photoshop)
#14
Script Showroom / Would you like some Water ?
Jul 13, 2020, 02:14 AM
Basic Thirst/Hunger Script
Thanks Xmair for helps <3
It can be "Hungery" script also, if you change the vars :D
Server Side
[spoiler][noae][noae][noae]function onScriptLoad()
{
   thirst <- array( 1000, 100 );
}

function onPlayerRequestSpawn( player )
{
    thirst[ player.ID ] = 100;
}

function onPlayerSpawn( player )
{
local th = thirst[ player.ID ]
                        local data = Stream();
                        data.StartWrite( );
                        data.WriteInt( 42 );
                        data.WriteString(th);
                        data.SendStream( player );
}
function Thirst()
{
for (local i = 0; i <GetMaxPlayers (); i ++)
{
local player = FindPlayer (i);
if (player)
{
if (player.IsSpawned)
{
if ( thirst[ player.ID ] >= 1 )
{
thirst[ player.ID ] -= 5;
local th = thirst[ player.ID ]
                        local data = Stream();
                        data.StartWrite( );
                        data.WriteInt( 42 );
                        data.WriteString(th);
                        data.SendStream( player );
}
if ( player.Vehicle )
{
thirst[ player.ID ] -= 0.00001;
local th = thirst[ player.ID ]
                        local data = Stream();
                        data.StartWrite( );
                        data.WriteInt( 42 );
                        data.WriteString(th);
                        data.SendStream( player );
}
else if ( thirst[ player.ID ] < 1 )
{
player.Speed = Vector( 0, 0, 0 );
                            player.Health -=100;
local th = thirst[ player.ID ]
                            local data = Stream();
                            data.StartWrite( );
                            data.WriteInt( 42 );
                            data.WriteString(th);
                            data.SendStream( player );
}
}
                if ( player.Health == 1 )
                {
                    thirst[ player.ID ] -= 0.001;
local th = thirst[ player.ID ]
                    local data = Stream();
                    data.StartWrite( );
                    data.WriteInt( 42 );
                    data.WriteString(th);
                    data.SendStream( player );
                }
}
}
}

 function onTimeChange(oldHour, oldMin, newHour, newMin)
{
switch( newMin )
{
case 0:
Thirst( );
break;
case 10:
Thirst( );
break;
case 20:
case 30:
case 40:
case 50:
Thirst( );
break;
}
}
[/noae][/noae][/noae][/spoiler]

Client Side [spoiler]
[noae][noae] Thirstu <- 100;

Peace <-
{
Tbar = null
Tlabel = null
Th = 100
}

function Server::ServerData(stream)
{
 local StreamReadInt = stream.ReadInt(),
  StreamReadString = stream.ReadString();
 switch (StreamReadInt.tointeger())
 {
case 42: local data = StreamReadString; Dude(); ::Thirstu = StreamReadString.tofloat(); break;
}
}

function Dude(){
Peace.Tbar = GUIProgressBar();
 Peace.Tbar.Pos = VectorScreen( sX * 0.0, sY*0.0 );
 Peace.Tbar.Size = VectorScreen( sX * 0.08, sY * 0.025 );
 Peace.Tbar.StartColour = Colour( 40, 255, 40 );
 Peace.Tbar.EndColour = Colour( 180, 110, 110 );
 Peace.Tbar.MaxValue = 100;
 Peace.Tbar.BackgroundShade = 0.3;
 Peace.Tbar.Thickness = 2;
 
 Peace.Tlabel = GUILabel( );
 Peace.Tlabel.Text = "Thirst";
 Peace.Tlabel.Pos = VectorScreen( sX * 0.0, sY*-0.01 );
 Peace.Tlabel.FontSize = 24;
 Peace.Tlabel.FontName = "Squada One";

 Peace.Tlabel.TextColour = Colour( 255, 255, 255 );
 Peace.Tbar.AddChild( Peace.Tlabel );


  Peace.Tbar.Value = ::Thirstu;
Peace.Th = ::Thirstu;
Peace.Tlabel.Text = "Thirst";
Peace.Tlabel.FontSize = 12;
Peace.Tlabel.FontName = "Squada One";

}
[/noae][/noae][/noae][/spoiler]

Have a nice day

There video gooo
https://www.youtube.com/watch?v=1vP4Q74Xe9c

Contact: Harun | KrOoB#2057
Test Server : 80.253.245.58:8191
#15
Script Showroom / KrOoB Server Script (OLD)
Nov 20, 2019, 12:15 PM
HI GUYS

I made the server script in tdm mode. The register system belongs to Mohamed & Car System belongs to KrlozZ, there are more than one script in it, and I thank them also


Commands

Player Commands : /nakityolla (givecash) |  /arabalarim (mycars) | /araba (getcar) | /surucu (driver) | /abilgi (carinfo) | /sat (sellcar) | /satinal (buycar) | /ilac (heal) | /yelek (armour) |  /istatistik (stats) | /sifredegis (changepass) | /cikis (logout) | /kayit (register) | /giris (login) | /yatir (deposit) | /cek (withdraw) | /raporla (report) | /banka (bank money) | /kural (rules) | /komutlar (commands) | /akomut (carcommands) | /silahlar (guns) | /a (anims) | /izle (spectate) | /izleme (leavespec) | /spree | /myspree | /arena |  /sarhos (drunk) | /ayik (notdrunk) | /tamir (fix) | /mypos || uhfff bro i'm tired

Admin Commands: /olumsuz (immortal baby :)) | /olumsuz (mortal) | /duyuru (announce) | /skin | /raporlistesi (reportlist) | /weather | /settime | /erit (unfreeze) | /dondur (freeze) |  /setarmour |  /kick | /setowner | /ban | /removecar | /addcar | /changepos | /changecol | /sethp

MODE = TDM

MADED BY KrOoB (Old Nick H4F)


INFORMATION

Buying / selling cars | reporting system | login system | ban / kick system | and customized weapons & cars, character skins and locations are set



DOWNLOAD



IF YOU DOWNLOAD MY SCRIPT THANKS BRO :)
IF YOU LIKE THIS POST THANKS BRO :)


IF IT'S GETTING ERROR COME PM OR DISCORD (Harun | KrOoB#1216)
#16
where's mistake

function LoadVehicles()
{
local start = clock();
local q4 = mysql_query(db, "SELECT Model, Position, Angle, Col1, Col2, Parked, rowid FROM vehicles"), splitPos, x, y, z, splitPark, px, py, pz, ax, ay, az
local q5;
local i = 0;
while (q5 = mysql_fetch_row(q4))
{
mysql_query( db, "UPDATE vehicles SET rowid = "+i+" WHERE Position="+q5[5]+"");
local model = q5[0];
splitPos = split(q5[1], ", ");
x = splitPos[0];
y = splitPos[1];
z = splitPos[2];
local Angle = q5[2];
local Col1 = q5[3];
local Col2 = q5[4];
CreateVehicle(model.tointeger(), 0, Vector(x.tofloat(), y.tofloat(), z.tofloat()), Angle.tofloat(), Col1.tointeger(), Col2.tointeger());
if (q5[5] != "N")
{
splitPark = split(q5[5], ", ");
px = splitPark[0];
py = splitPark[1];
pz = splitPark[2];
ax = splitPark[3];
ay = splitPark[4];
az = splitPark[5];
FindVehicle(i).SpawnPos = Vector(px.tofloat(), py.tofloat(), pz.tofloat());
FindVehicle(i).Pos = Vector(px.tofloat(), py.tofloat(), pz.tofloat());
FindVehicle(i).EulerSpawnAngle = Vector(ax.tofloat(), ay.tofloat(), az.tofloat());
FindVehicle(i).EulerAngle = FindVehicle(i).EulerSpawnAngle;
}
i++;
if (i == mysql_num_rows(q4))
{
local finish = clock() - start;
print(i + " vehicles created in " + finish + " sec");
}
}
mysql_free_result(q4);
GetSQLNextRow(q4);
}
#17
HI GUYS


It is a tutorial for those who can not run scripts that work with MySQL


Step One


Download it https://www.appserv.org/en/


Step Two



Run the .exe file named appserv-win32-8.6.0


Step Three



https://www.appserv.org/en/howto/ enter this page and follow the installation instructions


Step Four



The download and installation process is over, MySQL & Apache & PHPmyadmin


Step Five


Open the internet browser (Google Chrome,Opera,Explorer...etc) and
we write 127.0.0.1 in the link section. phpMyAdmin Database Manager Version 4.6.6 <-- click this


Step Six


We must have a home page now. Since we do not select a user name, we type root, we write the password we set in the program setup and we log in.


Step Seven


That's it
You - Thank you for installing MySQL in my computer


Me - No Problem Bro :)



KrOoB -
we are new because we are watching the old ???
#18
"mysql_fetch_assoc" How do I convert this to SQL?

mysql_query = QuerySQL ??

mysql_num_rows = GetSQLColumnData ??

mysql_fetch_assoc = GetSQLColumnCount  ???
#19
Client side


g_option3 = GUILabel();
function Script::ScriptLoad( )
{
   //score message ( I just copied the code for showing scores. )
       g_option3.Text = "Current Score: Reds: 0 || Blues: 0";
       g_option3.TextColour = Colour( 255, 0, 255 );
      g_option3.FontSize = 15;
      g_option3.Pos = VectorScreen( sizex * 0.8, sizey / 2 - 65 );
}
function Server::ServerData( stream )
{
 local strint = stream.ReadInt( );
 switch( strint.tointeger( ) )
{
case 4 :
     local txt = stream.ReadString();
     g_option3.Text = txt;
     break;
}
}

Server Side

function GUITeamScore()
{
// this function will be called everytime the scores change.
    local data = Stream();
    data.WriteInt( 4 );
    data.WriteString( "Current Score: Reds: " + RedScore + " || Blues: " + BlueScore );
    data.SendStream( null );
}

https://forum.vc-mp.org/?topic=4203.msg31075#msg31075
#20
How can i hide & show sprites  guys ?