Jump to content

FWCentral

Members
  • Posts

    161
  • Joined

  • Last visited

Everything posted by FWCentral

  1. yeah i think i can use that for what i need thank you
  2. Damn how stupid works great thanks Solidsnake! what about a vehicle attached to a towtruck how do i get the source of the vehicle attached?
  3. One more quick question please, Im creating mechanic job and i want to create a blip attached to vehicles after 20 seconds of them leaving it but i dont know how i can get the players vehicle. function abandonveh() local veh = ?? createBlipAttachedTo(veh, 55, getTeamFromName("Mechanic")) end function startvehtime() setTimer(abandonveh, 20000, 1) end addEventHandler ( "onVehicleExit", getRootElement(), startvehtime )
  4. Thanks SDK work perfect
  5. Hey thanks for the reply SDK i did post back earlier but wasnt logged in again the script you posted kinda works, when resource starts the blip is set the right color but when the player respawns his color goes black the color[1] [2] [3] is 0 0 0 so this is why it went black but yet i was still in a team so it should be the team color
  6. Didn't want to start a new topic so i decided to post here. I got another problem, I want to set the players blip to the color of the players team so i tried editing the playerblips resource to do that but the problem is it just sets the players blip to red and i dno why here's the code: -- needs configurable blip colors, and team support root = getRootElement () r, g, b = getTeamColor( getTeamFromName(getPlayerTeam( root )) ) -- i added this color = { r, g, b } -- changed this players = {} resourceRoot = getResourceRootElement ( getThisResource () ) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, color[r], color[g], color[b] ) else createBlipAttachedTo ( player, 0, 2, color[r], color[g], color[b] ) 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[r], color[g], color[b] ) --and this 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[r], color[g], color[b] ) -- and this 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
  7. Hey sorry i did send a reply before saying thanks JR10, I didn't notice i wasn't logged in anyways it works now it was the name in the saving of the team that was the error.
  8. Hey im trying to save player teams so when a player disconnects and reconnect they will be in the team. Here is the functions i used: local team = getAccountData (theCurrentAccount, "team") if (team) then setPlayerTeam(source, team) --and local team = getPlayerTeam(source) if (team) then setAccountData(account, "team", team) and it doesn't work, All the other things save using the same sort of way as above e.g position and sking esc but this wont
  9. Hey Samer, Yes now the sponsorship's are over. But if any players do not want/need there hosting anymore and decide to drop out of their plan i will notify you all here or VIA FWCentral, There is currently one space available and triplesnake has booked it with me by PM, Although if he doesn't contact me before somebody else does the space will disappear.
  10. FWCentral is sponsoring MTA:SA servers! We are giving away free hosting to any servers that don't have a sponsor. All you need to do in return is add a small banner at the bottom saying: Our sponsor: FWCentral.org - This is negotiable if you have a better idea. This way we get more people on our website and you get completely free hosting! We are accepting any game-modes and preferably servers that have players! To apply just sign up on FWCentral.org and press contact at the bottom and explain what your server is and we will get back to you ASAP or send an email with your application to [email protected] or you can PM me here but it may take a while to reply, Thanks for taking the time to read this and hope to see you all soon.
×
×
  • Create New...