-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You mean make the team blink?
-
Eh, didn't took me 10 min, already knew what was missing . You're welcome.
-
local teamName = ":O Awesome Players!" function setTeam ( _, account ) local acc = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. acc, aclGetGroup ( "SuperModerator" ) ) or isObjectInACLGroup ( "user.".. acc, aclGetGroup ( "Admin" ) ) ) then if ( not getTeamFromName ( teamName ) ) then mainTeam = createTeam ( teamName, 255, 50, 0 ) setPlayerTeam ( source, mainTeam ) end end end addEventHandler ( "onPlayerLogin", root, setTeam ) function unassignTeam ( ) local team = getPlayerTeam ( source ) if ( team == mainTeam ) then setPlayerTeam ( source, nil ) local players = countPlayersInTeam ( team ) if ( players == 0 ) then destroyElement ( team ) end end end addEventHandler ( "onPlayerLogout", root, unassignTeam )
-
allowedVehicles = { 602, 545, 469, .... } DDthirdMarker = createMarker ( -1353, 915, 1038, "cylinder", 5, 250, 0, 250, 255 ) setElementInterior ( DDthirdMarker, 15 ) function DDthirdTP ( markerHit, matchingDimension ) if ( markerHit == DDthirdMarker ) then local pick = math.random ( #allowedVehicles ) local spawnveh = createVehicle ( allowedVehicles [ pick ], -1359, 935, 1038 ) setElementInterior ( spawnveh, 15 ) warpPedIntoVehicle ( source, spawnveh ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), DDthirdTP )
-
allowedVehicles = { 602, 545, 469, .... } DDthirdMarker = createMarker ( -1353, 915, 1038, "cylinder", 5, 250, 0, 250, 255 ) setElementInterior ( DDthirdMarker, 15 ) function DDthirdTP ( markerHit, matchingDimension ) if ( markerHit == DDthirdMarker ) then local pick = math.random ( #allowedVehicles ) local spawnveh = createVehicle ( allowedVehicles [ pick ], -1359, 935, 1038 ) warpPedIntoVehicle ( source, spawnveh ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), DDthirdTP )
-
Change your table to something like this: allowedVehicles = { 602, 545, etc, etc... }
-
You changed the script type on the meta.xml to "client", right?
-
That kind of table won't work with math.random.
-
Then you have to make the script client side, since onPlayerDamage can't be cancelled. function skin1 ( ) local skin = getElementModel ( source ) if ( skin == 9 ) then cancelEvent ( ) setElementHealth ( source, ( getElementHealth ( source ) - 1 ) ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, skin1 )
-
Hold on, you want when the skin is 9, only take 1% of damage and cancel the rest?
-
function skin1 ( ) local skin = getElementModel ( source ) outputChatBox ( "THE SKIN IS: ".. tostring ( skin ) ) if ( skin == 9 ) then setElementHealth ( source, ( getElementHealth ( source ) - 1 ) ) else outputChatBox ( "SKIN ISN'T 9" ) end end addEventHandler ( "onPlayerDamage", getRootElement(), skin1 ) Try that and see what it outputs to chat when you damage a player.
-
local teams = { } function createTeamsOnStart ( ) local team = createTeam ( ":O Awesome Players!", 255, 50, 0 ) teams [ team ] = true end addEventHandler ( "onResourceStart", resourceRoot, createTeamsOnStart ) function setTeam ( _, account ) local acc = getAccountName ( account ) local team = "" if isObjectInACLGroup ( "user.".. acc, aclGetGroup ( "SuperModerator" ) ) then team = "Moderators" elseif isObjectInACLGroup ( "user.".. acc, aclGetGroup ( "Admin" ) ) then team = "Admins" end if ( team ~= "" ) then if ( not getTeamFromName ( team ) ) then local team = createTeam ( team, 255, 50, 0 ) teams [ team ] = true setPlayerTeam ( source, team ) end end end addEventHandler ( "onPlayerLogin", root, setTeam ) function unassignTeam ( ) local team = getPlayerTeam ( source ) if ( team and teams [ team ] ) then setPlayerTeam ( source, nil ) local players = countPlayersInTeam ( team ) if ( players == 0 ) then destroyElement ( team ) end end end addEventHandler ( "onPlayerLogout", root, unassignTeam )
-
Is it set as server side?
-
local player = getLocalPlayer() kpk = guiCreateStaticImage(X, Y,W,H, "images/kpk.png", true) tab = guiCreateTabPanel(X, Y,W,H, true, kpk) tab_inventory = guiCreateTab("Weap:", tab) function weapItemInInventory ( ) local inventory_gridlist = guiCreateGridList (0.03, 0.03, 0.46, 0.94, true, tab_inventory) local weapSlots = guiGridListAddColumn(inventory_gridlist, "??????", 0.9) if ( weapSlots ) then for slot = 1, 12 do local weapon = getPedWeapon ( localPlayer, slot ) if ( weapon > 0 ) then local row = guiGridListAddRow ( inventory_gridlist ) guiGridListSetItemText ( inventory_gridlist, row, weapSlots, getWeaponNameFromID ( weapon ), false, false ) end end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), weapItemInInventory )
-
Why are you using two save systems?
-
And what's the problem?
-
You're welcome.
-
addEventHandler("onPlayerLogin",root, function (_,acc) if isObjectInACLGroup("user." .. getAccountName(acc),aclGetGroup("Police")) then outputChatBox("* Welcome Admin Man Press n To Open Admin Panel",source,255,255,255,true) end end ) addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) data = 100 if ( getElementHealth ( toWho ) > 0 ) and ( not isPedDead ( toWho ) ) then if ( tonumber ( data ) > getElementHealth ( toWho ) ) then setTimer ( killPed, 50, 1, toWho ) else setElementHealth ( toWho, getElementHealth ( toWho ) - data ) end local x, y, z = getElementVelocity ( toWho ) setElementVelocity ( toWho, x , y, z + 0.2 ) outputChatBox("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) ------------------ function loggedOut ( ) triggerClientEvent ( source, "police", source, false ) end addEventHandler( "onPlayerLogout", getRootElement(), loggedOut ) function polstart ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup("user." .. accName, aclGetGroup("Police")) then triggerClientEvent ( player, "police", player, true ) end end addEvent( "polstart", true ) addEventHandler( "polstart", getRootElement(), polstart ) function onPlayerLogin ( ) polstart ( source ) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin )
-
That code is not the problem, post the whole script.
-
Topic locked by request of it's creator.
-
With just Lua, you can't do it, you'll have to do it with PHP.
-
What are you trying to do?
-
You're welcome.
-
You put "SetTimer" uppercase "S" and it's "setTimer".