gghvcffcv Posted March 15, 2014 Share Posted March 15, 2014 Hola amigos El problema en este script es que Cuando inicio los otros resources de trabajos por ejemplo; police LS, Police SF, Police LV En este script se crean markers de los otros resources Y los markers tienen diferentes localizaciones Teame = createTeam("SWAT", 0, 0, 100) CT = { [Teame] = true } CV = { [596] = true } function crearD() PoliciaD = createPed ( 285, 1288.12341, -1642.04602, 13.54688, 270, true ) createBlip ( 1288.12341, -1642.04602, 13.54688, 30, 2, 0, 0, 255, 255 ) MarcadorD = createMarker ( 1288.12341, -1642.04602, 12.54688, "cylinder", 1.0, 0, 0, 255, 255 ) end addEventHandler ( "onResourceStart", getRootElement(), crearD ) -------------------------------------------------------------- function aceptarr (hitElement) local team = getTeamFromName ( "SWAT" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 0, 100 ) setElementModel (source, 285) giveWeapon ( source, 23, 10000 ) giveWeapon ( source, 3, 1 ) giveWeapon ( source, 31, 500 ) giveWeapon ( source, 34, 200 ) giveWeapon ( source, 41, 5000 ) giveWeapon ( source, 46, 1 ) giveWeapon ( source, 29, 500 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) -------------------------------------------------------------- function cerrarr (hitElement) end addEvent( "onGreetinA", true ) addEventHandler( "onGreetinA", root, cerrarr ) -------------------------------------------------------------- MarcadorD = createMarker ( 1288.12341, -1642.04602, 12.54688, "cylinder", 1.0, 0, 0, 255, 255 ) addEventHandler("onClientMarkerHit", MarcadorD, function ( hitElement ) if ( hitElement == localPlayer ) then panel = guiCreateWindow(481, 144, 439, 427, "SARS:RPG Police Job", false) guiWindowSetSizable(panel, false) memo = guiCreateMemo(12, 32, 417, 198, "Welcome to the police Job of SAES:RPG, If you accept this job You will be given a NightStick, Silenced, and a Police Skin.", false, panel) guiMemoSetReadOnly(memo, true) aceptar = guiCreateButton(15, 242, 404, 66, "Accept Job", false, panel) guiSetFont(aceptar, "sa-header") cerrar = guiCreateButton(15, 341, 404, 66, "Close Window", false, panel) guiSetFont(cerrar, "sa-header") showCursor (true) addEventHandler ( "onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ( "onClientGUIClick", cerrar, cerrarr, false ) end end ) -------------------------------------------------------------- function aceptarr(hitElement) showCursor (false) guiSetVisible (panel, false) triggerServerEvent ( "onGreeting", localPlayer ) end -------------------------------------------------------------- function cerrarr(hitElement) showCursor (false) guiSetVisible (panel, false) triggerServerEvent ( "onGreetinA", localPlayer ) end -------------------------------------------------------------- Link to comment
manawydan Posted March 16, 2014 Share Posted March 16, 2014 probar cambiar: addEventHandler ( "onResourceStart", getRootElement(), crearD ) to addEventHandler ( "onResourceStart", resourceRoot, crearD ) Link to comment
Recommended Posts