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

Messages - rObInX

#1
Major bump.

Looking back to what I created as a kid, I'm super proud and happy. I don't know what is the current condition of 0.4 or if the script works at all. And I'm sure there are plenty of better code out there. But if you guys need this old script, I can try rewrite it in my free time. Or maybe we could all do it as a project, on a github repo.

Let me know your opinion. :)
#2
Can't you just use switch ?

Its way better and faster.
#3
Quote from: KAKAN on Sep 19, 2015, 11:40 AM"If a player hacks and sets his cash to $xxxx, he'll have that much cash for free.

Instead use some function like AddCash( player, Cash )"
Hacking still works?
Nope.
Player can only set his cash, not the server side one (if you use my method).

And, thanks Thijn.
#4
If a player hacks and sets his cash to $xxxx, he'll have that much cash for free.

Instead use some function like AddCash( player, Cash )

Eg:

function AddCash( p, c )
{
    pstats[p.ID].Cash += c.tointeger();
    player.Cash = pstats[p.ID].Cash.tointeger();
}
#5
Scripting and Server Management / Re: Weapon
Sep 18, 2015, 02:35 PM
Quote from: Mashreq on Sep 18, 2015, 02:11 PMThis should solve your problems:
function GetWepName(reason)
{
switch(reason.tointeger())
{
 case 100: return "C-WEP 1";
 case 101: return "C-WEP 2";
 default: return GetWeaponName(reason);
}
}

You forgot to convert the reason in default line to integer and also forgot break.
Dunno if break is necessary since return is present.
function GetWepName(reason)
{
    switch(reason.tointeger())
    {
         case 100: return "C-WEP 1";
                      break;
         case 101: return "C-WEP 2";
                      break;
         default: return GetWeaponName( reason.tointeger() );
    }
}
#6
Scripting and Server Management / Re: null
Sep 17, 2015, 09:38 AM
Quote from: xxkillerxx on Sep 17, 2015, 09:33 AMif i want to check any one else car with nick will it works

Why can't you try?
I'll fix the errors.

EDIT:

Since I was free, I've coded it.
Dunno if it works or not.
DON'T EXPECT PEOPLE TO CODE FOR YOU EVERY-TIME.

else if ( cmd == "car" )
{
if ( !text )
{
local veh = plr.Vehicle;
if ( veh )
{
local vid = veh.ID, hp = veh.Health.tointeger() /10;
MessagePlayer( plr.Name + " is driving a " + GetVehicleNameFromModel( veh.Model ) + " (ID: " + vid + ") (Health: " + hp + "%)", player );
local q = QuerySQL( db, "SELECT * FROM Vehicles WHERE ID='" + veh.ID + "'" );
if ( GetSQLColumnData( q, 1 ) )
{
MessagePlayer( "Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] Cost:[ " + GetSQLColumnData( q, 1 ) + " ]", player );
MessagePlayer( "ID:[ " + veh.ID + " ] Owner:[ " + GetSQLColumnData( q, 2 ) + " ] Share:[ " + GetSQLColumnData( q, 3 ) + " ]", player );
}
}
else MessagePlayer( "You're currently on foot.", player );
}
else
{
local plr = FindPlayer( text );
if ( !plr ) MessagePlayer( "[Error] - Invalid Nick/ID", player );
else if ( !plr.IsSpawned ) MessagePlayer( "[Error] - This player hasn't spawned.", player );
else
{
local veh = plr.Vehicle;
if ( veh )
{
local vid = veh.ID, hp = veh.Health.tointeger() /10;
MessagePlayer( plr.Name + " is driving a " + GetVehicleNameFromModel( veh.Model ) + " (ID: " + vid + ") (Health: " + hp + "%)", player );
local q = QuerySQL( db, "SELECT * FROM Vehicles WHERE ID='" + veh.ID + "'" );
if ( GetSQLColumnData( q, 1 ) )
{
MessagePlayer( "Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] Cost:[ " + GetSQLColumnData( q, 1 ) + " ]", player );
MessagePlayer( "ID:[ " + veh.ID + " ] Owner:[ " + GetSQLColumnData( q, 2 ) + " ] Share:[ " + GetSQLColumnData( q, 3 ) + " ]", player );
}
}
else MessagePlayer( plr.Name + " is currently on foot.", player );
}
}
}
#7
Scripting and Server Management / Re: null
Sep 17, 2015, 09:23 AM
To do what you meant, just remove the part where it asks for name. Is that so hard?
Please "learn" to script.

else if ( cmd == "car" )
 {
   local veh = player.Vehicle;
   if ( veh )
   {
        local vid = veh.ID, hp = veh.Health.tointeger() /10;
        MessagePlayer( plr + " is driving a " + GetVehicleNameFromModel( veh.Model ) + " (ID: " + vid + ") (Health: " + hp + "%)", player );
        local q = QuerySQL( db, "SELECT * FROM Vehicles WHERE ID='" + veh.ID + "'" );
        if ( GetSQLColumnData( q, 1 ) )
        {
         MessagePlayer( "Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] Cost:[ " + GetSQLColumnData( q, 1 ) + " ]", player );
         MessagePlayer( "ID:[ " + veh.ID + " ] Owner:[ " + GetSQLColumnData( q, 2 ) + " ] Share:[ " + GetSQLColumnData( q, 3 ) + " ]", player );
        }
     }
 }
#8
Do you insert played id in playerson when a player joins?
#9
Quote from: KAKAN on Sep 09, 2015, 03:41 PM
Quote from: FinchDon on Sep 09, 2015, 03:10 PMADM Admin Command :P
So any problems?

Ye, problem. I can remove your snippet.
But I won't. Coz you all suck.
#10
If you gave a look at S.L.C's post.
But, none did.

Here is the code coz no one understand words, only codes....

local Pos;
if ( GetSQLColumnData( q, 5 ) )
{
    Pos = GetSQLColumnData( q, 5 ).tostring();
    //rest of your stuf.
}
else No house
#11
What I did was, added custom car but never spawned it.
And tried to set player as driver!

Thanks.
#12
Thanks for the help.
Fixed btw.

<rObInX> !exec local plr = FindPlayer(0); AMessage( plr.Name + " " + GetVehicleNameFromModel( plr.Vehicle.Model ) );
P.S How can I set a player into a custom car?
I can't find it using FindVehicle.
#13

player.Vehicle returns some instance.
Is there any mistake from my side, in the execution?

Regards,
rObInX
#14
General Discussion / Re: VCMPConverters!
May 20, 2015, 03:16 PM
Where do I find a .ide to .xml converter?
#15
Show the code please.
Some mistake in numbering.