null

Started by :P, Sep 17, 2015, 08:13 AM

Previous topic - Next topic

:P

if i want to check any one else car with nick will it works
SLC is a good scripter but he always use bad words for abusing players :P

rObInX

#16
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 );
}
}
}

:P

kusnangi help me robin give me a cmds in which we not able to check anyone else car he dont know scripting i think i want which palyer in cars show him his car information dont want nick and for others want nick
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

#18
Try it

else if ( cmd == "car" )
{
 if ( !text )
 {
local veh= player.Vehicle; // robinx made mistake here by typing plr.Vehicle
  if (veh)
  {
   local vid = veh.ID, hp = veh.Health.tointeger() /10;
   MessagePlayer( player.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. So do instead /car <nick/id>", player );
 }
 else
 {
  local plr = GetPlayer( 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 );
  }
 }
}

Try now

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

#19
 if i gave a valid id its says invalid kusnangi
SLC is a good scripter but he always use bad words for abusing players :P

:P

thanx kusnangi and robin i tryed but i cant so i ask understood
SLC is a good scripter but he always use bad words for abusing players :P