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 - Mohamed Boubekri

#1
Videos & Screenshots / New announcement style
Sep 27, 2023, 10:24 AM
Simple one, but it's looks like the console is printing the text character by character.

#2
Scripting and Server Management / Question !
Sep 15, 2023, 02:28 PM
Hey everyone, i want to know if there any-way to put a label on a wall (object) or (custom object) ?
#3
Hey everyone, i want to create something like this:
local dataBlob = blob(512);
dataBlob.writestring(vehicle.Pos.x);
Message("here is your x: "+dataBlob.readblob(512));
But i get error in the second line, "data types string expected float/integer"
How i can put vehicle pos in blob ? if blob take only integer/float values, then how i can do the above example
in Array ?
#4
Hey everyone, i want to make a system, which will prevent car from moving when no one is driving it.
function onVehicleMove( vehicle, lastX, lastY, lastZ, newX, newY, newZ )
{
if (newX && newY && newZ && !player.Vehicle)
{
vehicle.Pos.x = lastX, vehicle.Pos.y = lastY, vehicle.Pos.z = lastZ;
}
else return;
}
The problem is, that function 'onVehicleMove' does not contain 'player', so how i can detect the player ?
I get error here
if (newX && newY && newZ && !player.Vehicle)  player dosen't defined.
#5
Hey everyone, i'm wondering if i can freeze the mouse instead of hiding it ? GUI.SetMouseEnabled(false);
Because, if we don't freeze it, the player can show the mouse again by clicking Alt Gr. Then the player can
cause errors in the console, for example if he click a button again & again.
#6
Hey everyone, i get the following error in the console when i shutdown my server CTRL + C
AN ERROR HAS OCCURED [unable to close due to unfinalized statements or unfinished backups]

CALLSTACK
*FUNCTION [onScriptUnload()] scripts/server-side.nut line [30]

LOCALS
[this] TABLE
[WARNING] onScriptUnload failed to execute -- check the console for more details.
That line which represent line [30]
DisconnectSQL( db );Actually i think that i need to make database free after i use it, by using FreeSQLQuery
local p = QuerySQL(db, INSERT......); FreeSQLQuery(p); Is that right ? if not then which is responsable for that error ?
unable to close due to unfinalized statements or unfinished backups
#7
Script Showroom / [Project] Full Start GUI v2
Aug 15, 2023, 05:03 PM
I noticed that the first version of this project was deleted Full Start GUI v1
and I didn't have a backup, so at the request of some friends,
I tried to make a second version of the project, the new version is more attractive and professional.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The point of this project 'Full Start GUI' is give the scripters a good start, and help them to understand
more about client-side.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Like always i tried my best to not leave any errors in the console or in the script, please if there anything
inform me.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have made a lot of effort not to leave any possibilities that may lead to errors in the console or in the database,
for example: If the player registered but he dosen't create a character (left the server), when he logged in (back), the server will put
him again in character area, in this case, to skip errors in Database.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To understand more about the much of possibilities i treated, please test the script, and figure out by yourself.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now let's see some pictures of the project:- (if the images dosen't show up then click here)





-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now let's install the project:-

Server-side
Client-side
Sprites

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Plugins that you need: squirrel, sqlite.
Remember me checkbox is working great, you can test all functions and use it, feel free.
All PNGs taken from here.
Credits: to everyone participated to make this game something great.
#8
Hey everyone, i have made this simple script for roleplay servers especially, have fun!

How to use: if you want to walk keep pressing alt, and stop pressing it if you want to stop.
Preview: https://www.youtube.com/shorts/TpJf7rXvkXo
Server-side:
enum StreamType
{
    a1 = 0x01
    a2 = 0x02
}

function onClientScriptData( player )
{
    local stream = Stream.ReadByte();
    switch ( stream )
    {
        case StreamType.a1:
        {
        if (player.Vehicle) return;
        player.SetAnim(0,0);       
        }
        break;   
        case StreamType.a2:
        {
        if (player.Vehicle) return;
        player.SetAnim(0,2);       
        }
        break;               
    }
}
Client-side:
enum StreamType
{
    a1 = 0x01
    a2 = 0x02
}
alt <- KeyBind( 0x12 );
local walking=false;

function Script::ScriptProcess()
{
if (walking == true) {
SendDataToServer(StreamType.a1);
}
}
function KeyBind::OnDown(key)
{
if (key == alt )
{
walking = true;
}
}
function KeyBind::OnUp(key)
{
if (key == alt )
{
walking = false;
SendDataToServer(StreamType.a2);
}
}
function SendDataToServer( ... )
{
    if( vargv[0] )
    {
        local   byte = vargv[0],
                len = vargv.len();
               
        if( 1 > len ) Console.Print( "ToClent <" + byte + "> No params specified." );
        else
        {
            local pftStream = Stream();
            pftStream.WriteByte( byte );

            for( local i = 1; i < len; i++ )
            {
                switch( typeof( vargv[i] ) )
                {
                    case "integer": pftStream.WriteInt( vargv[i] ); break;
                    case "string": pftStream.WriteString( vargv[i] ); break;
                    case "float": pftStream.WriteFloat( vargv[i] ); break;
                }
            }
           
            Server.SendData( pftStream );
        }
    }
    else Console.Print( "ToClient: Not even the byte was specified..." );
}
The system now is clean without any lag.
#9
Script Showroom / [Project] Full Start GUI
Apr 19, 2021, 07:11 PM
Salam Alaikum all, I am now going to present to you The Future of VCMP
Well, A Moroccan player is trying his best to offer you the best account system [GUI]
I'll give you some pictures first to understand what I mean:-





Okey, After you saw this VIDEO, I am sure that you will understand me all

Here is the video.

Well, now let's talk about it:- (Credits)

+Disable Multi Clienting. @EnForcer (When you in the server, You can't enter again)
+Players Names Conditions. @[R3V]Kelvin (Character area)
+Some help about sqlite & client-side. @AroliS^
+Nearby chat for RP. @Sonmez
+Bank Server. @Sebastian
+GUI editor. @Anik (Panel & bouttons & memo measure)
+Country Detector. @MatheuS (Original one by Nexus)
+Client Timers. @ysc3839
See the video for more details.

I Tried my best not to leave any error:- (see the console below)


How its work ?
When you joined the server its give you random names
And when you logged in, the server write your username & password in database
And when you create your character, the server write your character name in database
That is, and also there is LASTSKIN & LASTPOS system by me (see the video)


Because I will left the vcmp community, So this one now is yours feel free to edit it

https://www.mediafire.com/file/3uxtt7wp11n3fu5/.My_Server.rar/file

Remember the video is at the top.

Ramadan kareem to all muslims & arab.
#10
I have made this function:-
function Check(player)
{
for (local i = 0; i < GetMaxPlayers(); ++i)
{
local plr = FindPlayer(i);
if (plr.UID == player.UID )
{
MessagePlayer("Ok we kicking you out.",plr); //rani hna w last pos nzid nriglha
}
}
}
The function is not working, When i enter the server he is kick me out
The idea is, if the player was in server he is can't enter again, The server will catch him UID and kick him out.
#11
I have a function in client side that like a condition:-
if (after.edit.Text.len() > 0)

if (after.edit.Text.len() < 19)
As you see these condition, now the idea is i want to add a new condition that Meaning, the name must contain a symbol
I have take a function from mta sa forum just to you understand what i meaning:-
characterName = string.gsub(tostring(characterName), " ", "_")As i said before, i want to add a new condition that Meaning, the name must contain a symbol, and the symbole must be _ like in previous code, i want the name like John_smith, Mohamed_L'oujdi, i want if the player not typing the symbole return false.
#12
Please see the script to understand me :-
function onClientScriptData( player )
{
local int = Stream.ReadInt( ),
string = Stream.ReadString ( );
switch( int.tointeger() )
{
case 74: ////login////

local str2 = Stream.ReadString ( ); ///this password
local q = QuerySQL(Database, "SELECT * FROM Accounts WHERE Username = '"+string+"'"); //i think here is the problem

MessagePlayer("Here what is in data: "+q,player); // the message its appears but what is inserted its appears null
                                             // so when its appears null then can't give right username
// Yep i've check data there is user name with name: MohamedBk
// But when insert my username its show as null
if (!q)
{
if (stats[player.ID].Password == SHA256(str2))
{
MessagePlayer("[#ffff00]Successfully Logged in. Welcome", player);
stats[player.ID].Log = true;
stats[player.ID].UID = player.UID;
stats[player.ID].IP = player.IP;
}
else Stream.StartWrite( ); Stream.WriteInt( 8 ); Stream.SendStream( player );
}
else Stream.StartWrite( ); Stream.WriteInt( 9 ); Stream.SendStream( player );
break;
}
}
We'll, see the image to understand what i meaning:-

And yea, i'm sure 'MohamedBk' is in the data.
In the normal state, MohamedBk need to appears in the message instead null value.
MohamedBk = The name that I registered with, as well as the name in the database (Which should appear in the message)
#13
I'm trying to sent two case see it below:-
function GUI::ElementRelease(element, mouseX, mouseY)
{
switch (element)
{
case regiscom.regbut: //register boutton///
GUI.InputReturn(regiscom.user); //when player click register boutton he need to fill editbox first//
GUI.InputReturn(regiscom.pas); //but as you see here three edit box: user, pasword, repassword//
GUI.InputReturn(regiscom.repas); // actually i don't know if i have a problem here or no
}
}
Ok now see the function inputreturn below:-
function GUI::InputReturn(editbox)
{
switch(editbox)
{
case regiscom.user: case regiscom.pas: case regiscom.repas: //well as you see here, please if i have a problem tell me

if (regiscom.user.Text.len() > 0)
{
if (regiscom.pas.Text.len() > 0)
{
if (regiscom.repas.Text.len() > 0)
{
if (regiscom.pas.Text == regiscom.repas.Text)
{
SendDataToServertwo( regiscom.user.Text, regiscom.pas.Text, 70 ); //ok when the conditions met its send data to serv
}                                                               //but still i have a problem i'll tell you
else hihihihi(6);
}
else hihihihi(5);
}
else hihihihi(4);
}
else hihihihi(3);
}
}
Well, know see server side func below:-
function onClientScriptData( player )
{
local int = Stream.ReadInt( ),
string = Stream.ReadString ( );
switch( int.tointeger() )
{
case 70:
local str2 = Stream.ReadString ( ); ///pasword///
local q = QuerySQL(Database, "SELECT * FROM Accounts WHERE Username = '" + string + "'");
if (!q)
{
MessagePlayer("Ok your user: "+string+" and you pass: "+str,player);  //the message its show and work great, but its send two time

// ok know i'll tell you my problem
// when the two message show its show two time

QuerySQL(Database, "INSERT INTO Accounts ( Username, Password , Admin, Cash, Bank, LastPosX, LastPosY, LastPosZ, LastPos, IP, UID, UID2 ) VALUES ( '" + string + "', '" + SHA256(str2) + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + player.IP + "', '" + player.UniqueID + "', '" + player.UniqueID2 + "' )");
MessagePlayer("[#ffff00]Successfully Registered.", player);
MessagePlayer("[#ffff00]Don't forget your password [#CC6666]" + str2, player);
stats[player.ID].Password = SHA256(str2);
stats[player.ID].Admin = 0;
stats[player.ID].UID = player.UniqueID;
stats[player.ID].UID2 = player.UniqueID2;
stats[player.ID].IP = player.IP;
stats[player.ID].Reg = true;
stats[player.ID].Log = true;
}
else Stream.StartWrite( ); Stream.WriteInt( 11 ); Stream.SendStream( player );
break;
}
}
Like i tell you, its send two time, See the picture to understand me:-

Actually the message is only not repeated twice, but three ???
I want the message to repeated Once.
#14
SendDataToServertext(com.we32.Text, 15) // its send only one string
// but me i want two string one for username & one for password
// here is my function below

function SendDataToServertext(str, int)
{
    local message = Stream();
    message.WriteInt(int.tointeger());
    message.WriteString(str);
    Server.SendData(message);
}
As you saw above, How i can send two string like:- SendDataToServertext(one.Text,two.Text, 15).
#15
Need help about deleting that thing
#16
I want to show an image for full screen how ?
sprite_logo = GUISprite( "image.png", VectorScreen( sX * 0.2375, sY * 0.26 ) );
sprite_logo.Size = VectorScreen(200,200);
sprite_logo.Alpha = 255;
#17
Videos & Screenshots / ViceEvil Screenshots
Apr 28, 2018, 06:15 PM
Hello, I have make some photo and one video to show you my server.
Server aren't hosted yet, because here are no one sharing for free :P
Anyway Enjoy ;D

ViceEvil




#18
Hello, I know pickup.Remove() its working but, when i do it for my server say me error index "Remove" lol :'(
i'm using rel004 with latest update.
Anyway how to fix the chit?
FindPickup( text.tointeger() ).Remove();
#19
Hello, i'm creating a server with matches & rounds example blue vs red
anyway, i want the functions: start time, show time left
example i need just a idea, i want show for client side start time, example when matche started then time to will started
so can anybody give me the function start time or count time

also i need time left example /timeleft (show the time left after start a one match)
Thanks!
#20
General Discussion / Suicide Panel v1.0
Apr 10, 2018, 08:40 AM
Hello, i know my self i learned main side as complete, but client side its hard from my way
but i try to learn it as possible. i have disabled /kill cmd and i added /suicide instead
its just sample panel ;D
The Panel How its Look:-

Click Me.