 
        Michcio
Members- 
                Posts84
- 
                Joined
- 
                Last visited
Everything posted by Michcio
- 
	There's no errors but it doesn't work good.
- 
	There is an event onPlayerSpawn.
- 
	function onPlayerSpawn1 ( spawnpoint ) for id, player in ipairs( getElementsByType ( "player" ) ) do if getPlayerTeam(player) == getTeamFromName("Policja") then createBlipAttachedTo ( source, 0, 2, 0, 0, 255, 255, 0, 300, player ) end end end
- 
	I know but i make sth wrong.
- 
	Thanks but i have one more question. How to make playerblips visible only for this team?
- 
	Hi! How to make mapnames visible only to one team?
- 
	It hasn't got errors but i don't show me players in colshape.
- 
	no you must buy mysql database or install it on computer/server.
- 
	--[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local connection = nil local connection = nil local null = nil local results = { } local max_results = 128 -- connection functions local function connect( ) -- retrieve the settings local server = get( "server" ) or "write here your host or when it is local then write localhost" local user = get( "user" ) or "here write your username to your database" local password = get( "password" ) or "here password to your mysql database" local db = get( "database" ) or "here name of your database" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil -- connect connection = mysql_connect ( server, user, password, db, port, socket ) if connection then if user == "and here your username to database" then setTimer( outputDebugString, 100, 1, "Connecting to your MySQL as 'root' is strongly discouraged.", 2 ) end return true else outputDebugString ( "Connection to MySQL Failed.", 1 ) return false end end local function disconnect( ) if connection and mysql_ping( connection ) then mysql_close( connection ) end end local function checkConnection( ) if not connection or not mysql_ping( connection ) then return connect( ) end return true end addEventHandler( "onResourceStart", resourceRoot, function( ) if not mysql_connect then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL module missing." ) end cancelEvent( true, "MySQL module missing." ) elseif not hasObjectPermissionTo( resource, "function.mysql_connect" ) then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "Insufficient ACL rights for mysql resource." ) end cancelEvent( true, "Insufficient ACL rights for mysql resource." ) elseif not connect( ) then if connection then outputDebugString( mysql_error( connection ), 1 ) end if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL failed to connect." ) end cancelEvent( true, "MySQL failed to connect." ) else null = mysql_null( ) end end ) addEventHandler( "onResourceStop", resourceRoot, function( ) for key, value in pairs( results ) do mysql_free_result( value.r ) outputDebugString( "Query not free()'d: " .. value.q, 2 ) end disconnect( ) end ) -- function escape_string( str ) if type( str ) == "string" then return mysql_escape_string( connection, str ) elseif type( str ) == "number" then return tostring( str ) end end local function query( str, ... ) checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then for num = 1, max_results do if not results[ num ] then results[ num ] = { r = result, q = str } return num end end mysql_free_result( result ) return false, "Unable to allocate result in pool" end return false, mysql_error( connection ) end function query_free( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then mysql_free_result( result ) return true end return false, mysql_error( connection ) end function free_result( result ) if results[ result ] then mysql_free_result( results[ result ].r ) results[ result ] = nil end end function query_assoc( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then for result, row in mysql_rows_assoc( results[ result ].r ) do local num = #t + 1 t[ num ] = { } for key, value in pairs( row ) do if value ~= null then t[ num ][ key ] = tonumber( value ) or value end end end free_result( result ) return t end return false, error end function query_assoc_single( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then local row = mysql_fetch_assoc( results[ result ].r ) if row then for key, value in pairs( row ) do if value ~= null then t[ key ] = tonumber( value ) or value end end free_result( result ) return t end free_result( result ) return false end return false, error end function query_insertid( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local id = mysql_insert_id( connection ) free_result( result ) return id end return false, error end function query_affected_rows( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local rows = mysql_affected_rows( connection ) free_result( result ) return rows end return false, error end Do you have a mysql database?
- 
	"Everyone"> "Default" /> "user.*" /> "resource.*" /> "Admin"> "Admin" /> "Moderator" /> "RPC" /> "resource.admin" /> "user.seanny" /> "Moderator"> "Moderator" /> "Console"> "Admin" /> "RPC" /> "Developer" /> "user.Console" /> "RPC"> "RPC" /> "resource.world" /> "sql"> "sql" /> "resource.sql" /> "manageAccounts"> "manageAccounts" /> "IPandSerial" /> "resource.players" /> "kickban"> "kickban" /> "IPandSerial" /> "resource.parasite" /> "resource.players" /> "IPandSerial"> "IPandSerial" /> "resource.runcode" /> "Developer"> "Developer" /> "user.mabako" /> "Default"> "general.ModifyOtherObjects" access="false" /> "general.http" access="false" /> "command.start" access="false" /> "command.startall" access="false" /> "command.stop" access="false" /> "command.stopall" access="false" /> "command.restart" access="false" /> "command.restartall" access="false" /> "command.refresh" access="false" /> "command.refreshall" access="false" /> "command.addaccount" access="false" /> "command.delaccount" access="false" /> "command.debugscript" access="false" /> "command.chgpass" access="false" /> "command.loadmodule" access="false" /> "command.login" access="false" /> "command.logout" access="false" /> "command.upgrade" access="false" /> "command.mute" access="false" /> "command.unmute" access="false" /> "command.kick" access="false" /> "command.ban" access="false" /> "command.banip" access="false" /> "command.unbanip" access="false" /> "command.shutdown" access="false" /> "command.install" access="false" /> "command.aexec" access="false" /> "command.whois" access="false" /> "command.whowas" access="false" /> "command.run" access="false" /> "command.srun" access="false" /> "command.crun" access="false" /> "function.executeCommandHandler" access="false" /> "function.setPlayerMuted" access="false" /> "function.addAccount" access="false" /> "function.addBan" access="false" /> "function.removeBan" access="false" /> "function.removeAccount" access="false" /> "function.setAccountPassword" access="false" /> "function.kickPlayer" access="false" /> "function.banIP" access="false" /> "function.banPlayer" access="false" /> "function.banSerial" access="false" /> "function.getBansXML" access="false" /> "function.unbanIP" access="false" /> "function.unbanSerial" access="false" /> "function.getClientIP" access="false" /> "function.setServerPassword" access="false" /> "function.getServerPassword" access="false" /> "function.callRemote" access="false" /> "function.startResource" access="false" /> "function.stopResource" access="false" /> "function.restartResource" access="false" /> "function.createResource" access="false" /> "function.copyResource" access="false" /> "function.addResourceMap" access="false" /> "function.addResourceConfig" access="false" /> "function.removeResourceFile" access="false" /> "function.setResourceDefaultSetting" access="false" /> "function.removeResourceDefaultSetting" access="false" /> "function.redirectPlayer" access="false" /> "function.aclReload" access="false" /> "function.aclSave" access="false" /> "function.aclCreate" access="false" /> "function.aclDestroy" access="false" /> "function.aclSetRight" access="false" /> "function.aclRemoveRight" access="false" /> "function.aclCreateGroup" access="false" /> "function.aclDestroyGroup" access="false" /> "function.aclGroupAddACL" access="false" /> "function.aclGroupRemoveACL" access="false" /> "function.aclGroupAddObject" access="false" /> "function.aclGroupRemoveObject" access="false" /> "function.mysql_connect" access="false" /> "function.mysql_close" access="false" /> "function.mysql_errno" access="false" /> "function.mysql_error" access="false" /> "function.mysql_ping" access="false" /> "function.mysql_select_db" access="false" /> "function.mysql_escape_string" access="false" /> "function.mysql_affected_rows" access="false" /> "function.mysql_change_user" access="false" /> "function.mysql_get_character_set_info" access="false" /> "function.mysql_get_client_info" access="false" /> "function.mysql_get_client_version" access="false" /> "function.mysql_get_host_info" access="false" /> "function.mysql_get_proto_info" access="false" /> "function.mysql_get_server_info" access="false" /> "function.mysql_get_server_version" access="false" /> "function.mysql_hex_string" access="false" /> "function.mysql_info" access="false" /> "function.mysql_insert_id" access="false" /> "function.mysql_query" access="false" /> "function.mysql_unbuffered_query" access="false" /> "function.mysql_set_character_set" access="false" /> "function.mysql_stat" access="false" /> "function.mysql_warning_count" access="false" /> "Moderator"> "command.repairvehicle" access="true" /> "command.repairvehicles" access="true" /> "command.fillvehicle" access="true" /> "command.fillvehicles" access="true" /> "command.respawnvehicle" access="true" /> "command.respawnvehicles" access="true" /> "command.getvehicle" access="true" /> "command.gotovehicle" access="true" /> "command.temporaryvehicle" access="true" /> "command.setskin" access="true" /> "command.get" access="true" /> "command.goto" access="true" /> "command.announce" access="true" /> "command.modchat" access="true" /> "command.createshop" access="true" /> "command.deleteshop" access="true" /> "command.setdropoff" access="true" /> "command.kick" access="true" /> "command.setname" access="true" /> "command.freeze" access="true" /> "command.sethealth" access="true" /> "command.setvehiclecolor" access="true" /> "command.giveitem" access="true" /> "command.freecam" access="true" /> "command.spectate" access="true" /> "command.getpos" access="true" /> "command.toggleooc" access="true" /> "command.staffduty" access="true" /> "command.acceptreport" access="true" /> "Admin"> "general.ModifyOtherObjects" access="true" /> "general.http" access="true" /> "command.start" access="true" /> "command.startall" access="true" /> "command.stop" access="true" /> "command.stopall" access="true" /> "command.restart" access="true" /> "command.restartall" access="true" /> "command.refresh" access="true" /> "command.refreshall" access="true" /> "command.addaccount" access="true" /> "command.delaccount" access="true" /> "command.ban" access="true" /> "command.banip" access="true" /> "command.unbanip" access="true" /> "command.shutdown" access="false" /> "command.whois" access="true" /> "command.whowas" access="true" /> "command.createinterior" access="true" /> "command.deleteinterior" access="true" /> "command.setinterior" access="true" /> "command.setinteriorinside" access="true" /> "command.setinteriorname" access="true" /> "command.setinteriorprice" access="true" /> "command.createvehicle" access="true" /> "command.setwindowstinted" access="true" /> "command.setvehiclefaction" access="true" /> "command.reloadpermissions" access="true" /> "command.adminchat" access="true" /> "command.createteleport" access="true" /> "command.deleteteleport" access="true" /> "command.createatm" access="true" /> "command.createbank" access="true" /> "command.deleteatm" access="true" /> "command.deletebank" access="true" /> "command.createfaction" access="true" /> "command.setfaction" access="true" /> "command.setfactionrights" access="true" /> "command.setfactionrank" access="true" /> "command.createtext" access="true" /> "command.deletetext" access="true" /> "command.createfuelpoint" access="true" /> "function.executeCommandHandler" access="true" /> "function.setPlayerMuted" access="true" /> "function.addAccount" access="true" /> "function.addBan" access="true" /> "function.removeBan" access="true" /> "function.removeAccount" access="true" /> "function.setAccountPassword" access="true" /> "function.kickPlayer" access="true" /> "function.banIP" access="true" /> "function.banPlayer" access="true" /> "function.banSerial" access="true" /> "function.getBansXML" access="true" /> "function.unbanIP" access="true" /> "function.unbanSerial" access="true" /> "function.getClientIP" access="true" /> "function.setServerPassword" access="true" /> "function.getServerPassword" access="true" /> "function.callRemote" access="true" /> "function.startResource" access="true" /> "function.stopResource" access="true" /> "function.restartResource" access="true" /> "function.createResource" access="true" /> "function.copyResource" access="true" /> "function.addResourceMap" access="true" /> "function.addResourceConfig" access="true" /> "function.removeResourceFile" access="true" /> "function.setResourceDefaultSetting" access="true" /> "function.removeResourceDefaultSetting" access="true" /> "function.redirectPlayer" access="true" /> "function.aclReload" access="true" /> "function.aclSave" access="true" /> "function.aclCreate" access="true" /> "function.aclDestroy" access="true" /> "function.aclSetRight" access="true" /> "function.aclRemoveRight" access="true" /> "function.aclCreateGroup" access="true" /> "function.aclDestroyGroup" access="true" /> "function.aclGroupAddACL" access="true" /> "function.aclGroupRemoveACL" access="true" /> "function.aclGroupAddObject" access="true" /> "function.aclGroupRemoveObject" access="true" /> "Developer"> "general.WillNotBeAfkKicked" access="true" /> "command.srun" access="true" /> "command.crun" access="true" /> "command.debugscript" access="true" /> "command.reloadacl" access="true" /> "command.reloadpermissions" access="true" /> "command.addmap" access="true" /> "command.removemap" access="true" /> "command.setmapdimension" access="true" /> "RPC"> "function.callRemote" access="true" /> "sql"> "function.mysql_connect" access="true" /> "function.mysql_close" access="true" /> "function.mysql_errno" access="true" /> "function.mysql_error" access="true" /> "function.mysql_ping" access="true" /> "function.mysql_select_db" access="true" /> "function.mysql_escape_string" access="true" /> "function.mysql_affected_rows" access="true" /> "function.mysql_change_user" access="true" /> "function.mysql_get_character_set_info" access="true" /> "function.mysql_get_client_info" access="true" /> "function.mysql_get_client_version" access="true" /> "function.mysql_get_host_info" access="true" /> "function.mysql_get_proto_info" access="true" /> "function.mysql_get_server_info" access="true" /> "function.mysql_get_server_version" access="true" /> "function.mysql_hex_string" access="true" /> "function.mysql_info" access="true" /> "function.mysql_insert_id" access="true" /> "function.mysql_query" access="true" /> "function.mysql_unbuffered_query" access="true" /> "function.mysql_set_character_set" access="true" /> "function.mysql_stat" access="true" /> "function.mysql_warning_count" access="true" /> "function.shutdown" access="false" /> "manageAccounts"> "function.aclGroupAddObject" access="true" /> "function.aclSave" access="true" /> "function.aclGroupRemoveObject" access="true" /> "function.addAccount" access="true" /> "function.setAccountPassword" access="true" /> "function.removeAccount" access="true" /> "kickban"> "function.kickPlayer" access="true" /> "function.addBan" access="true" /> "function.banPlayer" access="true" /> "IPandSerial"> "function.getClientIP" access="true" /> "function.getPlayerSerial" access="true" /> Try like that and check your sql resource (file mysql.lua) and show it.
- 
	Hi! I have a problem with my gridlist. Gridlist is good, but there aren't any players in it. Please help me! local x,y = getElementPosition(getLocalPlayer()) colshape = createColCircle ( x, y, 20.0 ) playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) guiSetVisible(playerList,false) function createPlayerList () -- Create the grid list -- Create a players column in the list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then -- If the column has been created, fill it with players for id, playeritem in ipairs(getElementsWithinColShape ( colshape, "player" )) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end addEventHandler ( "onClientGUIClick", row, click ) end end addEventHandler ( "onClientResourceStart", getRootElement(), createPlayerList ) function click ( button, state, sx, sy, x, y, z, elem, gui ) -- if state is down ( not to trigger the function twice on mouse button up/down), clicked gui and the element is our player list if ( source == playerList ) then -- get the player name from the selected row, first column local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) outputChatBox ( playerName ) -- output it to chat box end end function visible () guiSetVisible(playerList,true) showCursor(true) end addCommandHandler("pokaz",visible)
- 
	Potrzebuje pomocy z GridlistMichcio replied to Michcio's topic in Pomoc ze skryptami i programowaniem w Lua local x,y = getElementPosition(getLocalPlayer()) colshape = createColCircle ( x, y, 20.0 ) playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) guiSetVisible(playerList,false) function createPlayerList () -- Create the grid list -- Create a players column in the list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then -- If the column has been created, fill it with players for id, playeritem in ipairs(getElementsWithinColShape ( colshape, "player" )) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end addEventHandler ( "onClientGUIClick", row, click ) end end addEventHandler ( "onClientResourceStart", getRootElement(), createPlayerList ) function click ( button, state, sx, sy, x, y, z, elem, gui ) -- if state is down ( not to trigger the function twice on mouse button up/down), clicked gui and the element is our player list if ( source == playerList ) then -- get the player name from the selected row, first column local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) outputChatBox ( playerName ) -- output it to chat box end end function visible () guiSetVisible(playerList,true) showCursor(true) end addCommandHandler("pokaz",visible) Powiesz mi co tutaj jest źle? Gridliste tworzy, ale nie ma w niej żadnego gracza. PS. Wszystkiego najlepszego!
- 
	You haven't got connection with your MYSQL database. Show us your sql resource and we will help you.
- 
	Witam! Mam pytanie. Jak zrobić, by w gridlist pokazywało graczy będących w pobliżu? Wiem jak zrobić, by pokazywało wszystkich graczy, ale potrzebuje by pokazywało tylko tych będących w pobliżu. Proszę o pomoc i dzięki!
- 
	O.K. Thanks to all! It's work now.
- 
	It doesnt work
- 
	drv = getElementbyID("drv") drvctrls = {accelerate="num_8",brake_reverse="num_2",vehicle_left="num_4",vehicle_right="num_6",handbrake="num_5"} function ctrldrv () for ctrl,key in pairs(drvctrls) do setPedControlState(drv,ctrl,getKeyState(key)) end end addEventHandler("onClientPreRender",getRootElement(),ctrldrv) It was a mistake in 2 line but it doesnt work. eAi when i press num_2 nothing happens. Ped and vehicle creating is good.
- 
	Hello! I wrote a script to take control of ped, but it doesnt work. Please help me with this. Server: function bot () me = getPlayerFromNick("Michcio") car = createVehicle(411,0,5,3) drv = createPed(105,0,0,3) setElementID(drv,"drv") warpPedIntoVehicle(drv,car) end addEventHandler("onResourceStart",getRootElement(),bot) Client: drv = getElementbyID("drv") drvctrls = {accelerate="num_8,brake_reverse="num_2",vehicle_left="num_4",vehicle_right="num_6",handbrake="num_5"} function ctrldrv () for ctrl,key in pairs(drvctrls) do setPedControlState(drv,ctrl,getKeyState(key)) end end addEventHandler("onClientPreRender",getRootElement(),ctrldrv)
- 
	-- needs configurable blip colors, and team support root = getRootElement () color = { 255, 255, 255 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) police = getTeamFromName("Policja") swat = getTeamFromName("S.W.A.T.") team = getPlayerTeam(player) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if team ~= police and team ~= swat then if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end function onPlayerSpawn ( spawnpoint ) if team ~= police and team ~= swat then 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 function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end function setBlipsColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } for id, player in ipairs( getElementsByType ( "player" ) ) do destroyBlipsAttachedTo ( player ) if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end function setBlipColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then destroyBlipsAttachedTo ( source ) players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) end end addCommandHandler ( "setblipscolor", setBlipsColor ) addCommandHandler ( "setblipcolor", setBlipColor ) addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) function destroyBlipsAttachedTo(player) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end Thats what i make. It doesn't work.
- 
	So do anybody help me? I tried to make this but it didn't work. Please.
- 
	dzek kolego jesteś z Polski? Proszę pomoż mi z tym. LUA trochę szkole ale nie mogę tego wykombinować do końca. Jak już coś mi wyjdzie to wtedy nie działa ten pierwszy skrypt. Pomóż.
- 
	Thanks, but how to make this unvisible? -- needs configurable blip colors, and team support root = getRootElement () color = { 255, 255, 255 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end function onPlayerSpawn ( spawnpoint ) 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 function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end function setBlipsColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } for id, player in ipairs( getElementsByType ( "player" ) ) do destroyBlipsAttachedTo ( player ) if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end function setBlipColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then destroyBlipsAttachedTo ( source ) players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) end end addCommandHandler ( "setblipscolor", setBlipsColor ) addCommandHandler ( "setblipcolor", setBlipColor ) addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) function destroyBlipsAttachedTo(player) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end please help me
