micheal1230 Posted January 23, 2012 Share Posted January 23, 2012 (edited) Well The Title Says All Here Are Some IG Pics And A Pic On The Script IG Error In Debug Script 3 Script Edited January 23, 2012 by Guest Link to comment
BriGhtx3 Posted January 23, 2012 Share Posted January 23, 2012 post the script of the resource item-system Link to comment
micheal1230 Posted January 23, 2012 Author Share Posted January 23, 2012 xthepr0mise said: post the script of the resource item-system Lol Im Not That Stupid There Is Too Many Scripts In It Link to comment
BriGhtx3 Posted January 23, 2012 Share Posted January 23, 2012 I just want the script of the function giveItem -.- Link to comment
micheal1230 Posted January 23, 2012 Author Share Posted January 23, 2012 xthepr0mise said: I just want the script of the function giveItem -.- kay its in Admin script -- /GIVEITEM function givePlayerItem(thePlayer, commandName, targetPlayer, itemID, ...) if (exports.global:isPlayerAdmin(thePlayer)) then if not (itemID) or not (...) or not (targetPlayer) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [item ID] [item Value]", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer) if targetPlayer then local logged = getElementData(targetPlayer, "loggedin") itemID = tonumber(itemID) local itemValue = table.concat({...}, " ") itemValue = tonumber(itemValue) or itemValue if ( itemID == 74 or itemID == 75 or itemID == 78 ) and not exports.global:isPlayerScripter( thePlayer ) and not exports.global:isPlayerHeadAdmin( thePlayer) then -- nuthin elseif ( itemID == 84 ) and not exports.global:isPlayerLeadAdmin( thePlayer ) then elseif (logged==0) then outputChatBox("Player is not logged in.", thePlayer, 255, 0, 0) elseif (logged==1) then local name = call( getResourceFromName( "item-system" ), "getItemName", itemID ) if itemID > 0 and name and name ~= "?" then local success, reason = exports.global:giveItem(targetPlayer, itemID, itemValue) if success then exports.global:sendMessageToAdmins("AdmCmd: " .. getPlayerName(thePlayer) .. " gave " .. targetPlayerName .. " a " .. name .. " with value " .. itemValue .. ".") outputChatBox("Player " .. targetPlayerName .. " now has a " .. name .. " with value " .. itemValue .. ".", thePlayer, 0, 255, 0) exports.logs:logMessage(getPlayerName(thePlayer):gsub("_", " ") .. " gave " .. targetPlayerName .. " a " .. name .. " with value " .. itemValue, 13) if itemID == 2 or itemID == 17 then triggerClientEvent(targetPlayer, "updateHudClock", targetPlayer) end else outputChatBox("Couldn't give " .. targetPlayerName .. " a " .. name .. ": " .. tostring(reason), thePlayer, 255, 0, 0) end else outputChatBox("Invalid Item ID.", thePlayer, 255, 0, 0) end end end end end end addCommandHandler("giveitem", givePlayerItem, false, false) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now