Liberty Unleashed
Scripting => Script Help => Topic started by: aledark24 on December 08, 2013, 12:57:25 am
-
Hello im new in this thing of Gta 3 MP :p
Many player know my name in Vcmp :p im a scripter in vcmp
but recently im enter in LU but i dont know a shit in sql xD
so i ask a "simple cmd" need the /wep
:p please :P
sorry for my bad english xD
Thank you :D ;D ;D ;D
-
Here:
function onPlayerCommand ( pPlayer, szCommand, szParams ) {
if ( szCommand == "wep" )
{
if ( !szParams ) MessagePlayer ( "Unknown usage, type: /wep ( ID / NAME )", pPlayer, 255, 0, 0 );
else if ( IsNum ( szParams ) ) // Get a weapon by ID
{
local szName = GetWeaponName ( szParams.tointeger ( ) ); // This locals returns the name of the weapon by ID
pPlayer.SetWeapon ( szParams.tointeger ( ), 500 ); // 500 it's the ammo
MessagePlayer( "You've get a " + szName + ", ID " + szParams, pPlayer, 255, 255, 255 );
}
else // Get a weapon by Name
{
local iID = GetWeaponIDFromName ( szParams ); // This local returns the ID of the weapon from its name
local szName = GetWeaponName ( iID ); // This locals returns the name of the weapon by ID
pPlayer.SetWeapon ( iID, 500 ); // 500 it's the ammo
MessagePlayer( "You've get a " + szName + ", ID " + iID, pPlayer, 255, 255, 255 );
}
}
return 1;
}
Tested and works 100%. Have a nice day, aledark24.
thank you very much :), damn squirrel is my weakness, if you ever need something to VCMP "pawn script" I'll help you gladly