Code Select
function onPlayerHealthChange( player, lastHP, newHP )
{
if ( lastHP > newHP ) MessagePlayer( "You just lost " + ( lastHP - newHP ) + " health.", player );
}
https://wiki.vc-mp.org/wiki/OnPlayerHealthChange
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 Menufunction onPlayerHealthChange( player, lastHP, newHP )
{
if ( lastHP > newHP ) MessagePlayer( "You just lost " + ( lastHP - newHP ) + " health.", player );
}
Quote from: . on Jun 06, 2016, 11:30 PMYou're using an old plugin. Update your stuff.Solved. Thanks!
Quote from: KAKAN on Jun 05, 2016, 04:26 PMThanksQuote from: . on Jun 05, 2016, 04:25 PMYou probably need:what? mysqlclient? He's using SQLite. That happened to me too. Use Thijn's builds and try:-sudo apt-get install libmysqlclient18
http://vcmp.thijn.ovh/builds/
Quote from: [DS]Anik on Jan 16, 2016, 10:14 AMOff:- Which SOftware are u using for editing scripts?? Can u give me Download Link??
Quote from: Williams on Jan 16, 2016, 04:17 AMThis topic already posted. Btw great!This is different.
db <- ConnectSQL( "Spawnwep.db" );
QuerySQL( db,"CREATE TABLE IF NOT EXISTS Spawnwep( Nick TEXT, Weps TEXT)");
SpawnwepPlayer <- array( GetMaxPlayers(), null );
LoadSpawnwep(player);
GiveSpawnwep(player);
if (SpawnwepPlayer[ player.ID ] != null)
{
if(!CheckTableSpawnwep( player )) QuerySQL( db, "REPLACE INTO Spawnwep( Nick, Weps ) VALUES ( '" + player.Name + "','"+ SpawnwepPlayer[ player.ID ] + "' ) ");
else QuerySQL( db, "UPDATE Spawnwep SET Weps='"+ SpawnwepPlayer[ player.ID ] +"' WHERE Nick='" + player.Name + "'" );
SpawnwepPlayer[ player.ID ] = null; print( player.Name +"'s Spawnwep Saved!" );
}
//=================================SPAWNWEP STSTEM BY MACK==========================================================
function CheckTableSpawnwep( player )
{
local si = GetSQLColumnData( QuerySQL( db, "SELECT Weps FROM Spawnwep WHERE Nick='" + player.Name + "'" ), 0 );
if ( si ) return si;
else return 0;
}
//-------------------------------------------------------------------------------------------------------------------
function LoadSpawnwep(player)
{
if(CheckTableSpawnwep( player )) SpawnwepPlayer[ player.ID ] = CheckTableSpawnwep( player );
else SpawnwepPlayer[ player.ID ] = null;
}
//-------------------------------------------------------------------------------------------------------------------
function GiveSpawnwep(player)
{
if (SpawnwepPlayer[ player.ID ] != null)
{
local i = 1, khe = SpawnwepPlayer[ player.ID ], Nweps = NumTok( khe," ");
while ( i < (Nweps.tointeger()+1))
{
local ID = GetTok( khe," ", i);
player.SetWeapon( ID.tointeger(), 99999 ); i++;
}
ClientMessage("-> [#83bab3][SPAWNWEP] Weapons setting in spawn, Completed successfully.",player,255,0,102);
}
}
//=================================SPAWNWEP STSTEM BY MACK==========================================================
//-------------------------------------------------------------------------------------------------------------------
function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}
//-------------------------------------------------------------------------------------------------------------------
function GetPlayer( target )
{
local target1 = target.tostring();
if ( IsNum( target ) )
{
target = target.tointeger();
if ( FindPlayer( target) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
//-------------------------------------------------------------------------------------------------------------------
if ( cmd == "spawnwep" )
{
if ( !text ) ClientMessage( "[#ea4335]-> Error: [#fbbc05]Type /spawnwep <Wep1> <Wep2> <Wep3> <Wep4> <Wep5> <Wep6>...", player,0,0,0 );
else
{
local weps = split( text, " " ),ID, wepsset = null;
for( local i = 0; i < weps.len(); i++ )
{
( IsNum( weps[ i ] ) ) ? ID = weps[ i ].tointeger() : ID = GetWeaponID( weps[ i ] );
if ( ID >= 33 ) ClientMessage( "[#ea4335]-> Error: [#c0c0c0]Invalid Weapon ID/Name.", player,0,0,0 );
else
{
player.SetWeapon( ID, 99999 );
ClientMessage( "-> [#daff00]Saving " + GetWeaponName( ID ) + " to your spawn.",player,255,0,102);
if (wepsset == null) wepsset = " "+ ID;
else wepsset += (" " + ID);
}
}
if (wepsset) SpawnwepPlayer[ player.ID ] = wepsset;
}
}
else if ( cmd == "spawnwepdel")
{
if ( CheckTableSpawnwep( player ) )
{
QuerySQL( db, "DELETE FROM SpawnWep WHERE Nick='" + player.Name + "' COLLATE NOCASE" );
ClientMessage( "-> Your Spawnwep have been deleted.",player,255,0,102); SpawnwepPlayer[ player.ID ] = null;
}
else ClientMessage( "-> Error: You not have spawnwep.",player,255,0,102);
}