-
Posts
4,961 -
Joined
-
Last visited
Everything posted by Jaysds1
-
NVM I don't need help with the Pay n Spray script anymore. But I still need help with the Update GUI.
-
ok Edit: here: addEventHandler ( "onPlayerJoin",getResource(getThisResource()), function() spawnPlayer (client, x, y, z, 0, math.random (1,288), 0, 0, teamF) end)
-
Ya, We're tryin to help you and your saying "WTF"
-
Did you tried it?
-
ok Edit: Do you mean the one in the script or you want the player to spawn?
-
ooohhhh ok, your right JR10
-
try this then: addEventHandler ( "onClientResourceStart", getRootElement(getThisResource()), function( resource, source ) for id, source in ipairs( getElementsByType ( "source" ) ) do if getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end end) addEventHandler ( "onPlayerSpawn",getRootElement(), function( spawnpoint ) if getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end) I added the Event Handlers so when the resource start the blip is on the person, and when the player spawns it moves with them.
-
ok here: function onResourceStart ( resource, source ) for id, source in ipairs( getElementsByType ( "source" ) ) do if getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end end function onPlayerSpawn ( spawnpoint ) if getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end
-
what are you trying to do here?
-
there is no such thing, unless someone could create one.
-
i tested this, this has no error: function onResourceStart ( resource, source ) for id, source in ipairs( getElementsByType ( "source" ) ) do if getPlayerTeam" class="kw2">getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam" class="kw2">getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end end function onPlayerSpawn ( spawnpoint ) if getPlayerTeam" class="kw2">getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam" class="kw2">getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end
-
ok I found the reason try this: function onResourceStart ( resource, client ) for id, client in ipairs( getElementsByType ( "client" ) ) do if getPlayerTeam" class="kw2">getPlayerTeam class="kw2">getPlayerTeam(client) ~= nil then local r, g, b = getTeamColor(getPlayerTeam" class="kw2">getPlayerTeam" class="kw2">getPlayerTeam(client)) createBlipAttachedTo ( client, 0, 2, r,g,b ) else elseif ( players[client] ) then createBlipAttachedTo ( client, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( client, 0, 2, color[1], color[2], color[3] ) end end end function onPlayerSpawn ( spawnpoint ) if getPlayerTeam1(client) ~= nil then local r, g, b = getTeamColor(getPlayerTeam1(client)) createBlipAttachedTo ( client, 0, 2, r,g,b ) else elseif ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end
-
he said that the script doesn't work with or without the numbers.
-
ok here: cost = 10000 local paynspray = { } local payNSprayCol = { } local sensitiveMark = { } function paynsprayLoad ( res ) local paynsprayElements = getElementsByType ( "paynspray", getResourceRootElement(res) ) for k,v in ipairs(paynsprayElements) do local num = #paynspray+1 paynspray[num] = { } paynspray[num].Name = getElementData( v, "name" ) paynspray[num].PosX = tonumber( getElementData( v, "posX" ) ) paynspray[num].PosY = tonumber( getElementData( v, "posY" ) ) paynspray[num].PosZ = tonumber( getElementData( v, "posZ" ) ) if ( paynspray[num].PosX and paynspray[num].PosY and paynspray[num].PosZ ) then payNSprayCol = createColSphere ( paynspray[num].PosX, paynspray[num].PosY, paynspray[num].PosZ, 4 ) if getElementData( v, "isInGarage" ) ~= "false" then local garageNum = getElementData( v, "isInGarage" ) colGarage = createColSphere ( paynspray[num].PosX, paynspray[num].PosY, paynspray[num].PosZ, 13 ) setElementData ( colGarage, "garageNumber", ""..garageNum.."" ) addEventHandler( "onColShapeHit", colGarage, openGarage ) addEventHandler( "onColShapeLeave", colGarage, closeGarage ) end paynspray[num].marker = createMarker ( paynspray[num].PosX, paynspray[num].PosY, paynspray[num].PosZ, "cylinder", 3, 200, 200, 0, 200 ) paynspray[num].bliper = createBlip ( paynspray[num].PosX, paynspray[num].PosY, paynspray[num].PosZ, 63, 0, 0, 0, 255 ) addEventHandler( "onColShapeHit", payNSprayCol, paynsprayEnter ) end end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), paynsprayLoad ) function paynsprayUnload ( res ) for i=1,#paynspray do destroyElement(paynspray[i].marker); destroyElement(paynspray[i].bliper); end end addEventHandler( "onResourceStop", getResourceRootElement(getThisResource()), paynsprayUnload ) function openGarage (element) if ( getElementType ( element ) == "vehicle" ) then local garageNum = getElementData ( source, "garageNumber" ) if ( not isGarageOpen ( tonumber(garageNum) )) then setGarageOpen ( tonumber(garageNum), true ) end end end function closeGarage (element) if ( getElementType ( element ) == "vehicle" ) then local garageNum = getElementData ( source, "garageNumber" ) setGarageOpen ( tonumber(garageNum), false ) end end function paynsprayEnter ( client ) local vehicle = getPedOccupiedVehicle(client) vehicles = getElementsByType ( "vehicle" ) if getPlayerMoney ( client ) >= cost then takePlayerMoney ( client,(cost)) for vehicleKey, vehicleValue in ipairs(vehicles) do fixVehicle ( vehicleValue ) end else outputChatBox ( "You cannot afford to fix this car!",client, 0, 0, 0) end end
-
Sorry, I only got the background I'm about to create the gui you wanted.
-
ok EDIT: It says: [2011-06-12 12:43:37] ERROR: PayNSpray\paynspray.lua:61: attempt to compare nil with number [2011-06-12 12:43:37] WARNING: PayNSpray\paynspray.lua:59: Bad 'ped' pointer @ 'getPedOccupiedVehicle'(1) [2011-06-12 12:43:37] WARNING: PayNSpray\paynspray.lua:61: Bad 'player' pointer @ 'getPlayerMoney'(1) [2011-06-12 12:43:37] ERROR: PayNSpray\paynspray.lua:61: attempt to compare nil with boolean
-
NVM add back the numbers then.
-
Try this function onResourceStart ( resource, client ) for id, client in ipairs( getElementsByType ( "client" ) ) do if getPlayerTeam" class="kw2">getPlayerTeam(client) ~= nil then local r, g, b = getTeamColor(getPlayerTeam" class="kw2">getPlayerTeam(client)) createBlipAttachedTo ( client, 0, 2, r,g,b ) else elseif ( players[client] ) then createBlipAttachedTo ( client, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( client, 0, 2, color[1], color[2], color[3] ) end end end function onPlayerSpawn ( spawnpoint ) if getPlayerTeam1(client) ~= nil then local r, g, b = getTeamColor(getPlayerTeam1(client)) createBlipAttachedTo ( client, 0, 2, r,g,b ) else elseif ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end
-
Darklink, Instead of posting more why didn't you use the "Edit" button and add all the post in there.
-
Next time use the "EDIT" button. That's just a waste of posting.
-
Ya, what server are you on? And this is not suppose to be on a forum, your suppose to send the problem to the server Admin.
-
And i need help with a script, I want to take the player money and fix there vehicle, but if they don't have enough then output "You don't have enough to fix you vehicle". here is my script: ONLY SERVER-SIDE function paynsprayEnter ( client ) vehicles = getElementsByType ( "vehicle" ) if getPlayerMoney ( client ) >= cost then takePlayerMoney ( client,(cost)) for vehicleKey, vehicleValue in ipairs(vehicles) do fixVehicle ( vehicleValue ) end else outputChatBox ( "You cannot afford to fix this car!",client, 0, 0, 0) end end