~P0W3R~ Posted June 29, 2013 Share Posted June 29, 2013 Hola,Queria preguntar como ago que cada nivel de busqueda del jugador de diferente dinero al policia y diferente tiempo en jail al criminal osea menos nivel de busqueda menos dinero para el policia y menos tiempo en jail para el criminal y mas nivel de busqueda mas dinero para el policia y mas tiempo en la jail para el criminal. Gracias , espero sus respuestas. createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) givePlayerMoney (attacker, 3000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 Tiempo: setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) Dinero: givePlayerMoney (attacker, 3000) Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 si solid pero yo quiero que de ejemplo: 1 estrella $1500,2 estrella $2500,3 estrellas $3500,4 estrellas $4500,5 estrellas $5500 y 6 estrellas $6500 ese el ejemplo de dinero y maximo de 15 minutos jail Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 Podes usar una tabla para definir cuanto dinero y cuanto tiempo por estrella. Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 me podes dar un ejemplo? Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 Ese script funcionaria para poner el nivel de busqueda en el nombre. P.D: El script ese lo sacaste del foro. Link to comment
AlvareZ_ Posted June 29, 2013 Share Posted June 29, 2013 O podrias usar getPlayerWantedLevel, Ejemplo: function busqueda () local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 3 ) then -- Cantidad del nivel, el if Verifica que si "nivel" definido anteriormente es de 3 ">" Saldría el mensaje en el chat outputChatBox ( "Tienes 3 Niveles de Busqueda" ) end end Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 O podrias usar getPlayerWantedLevel, Ejemplo: function busqueda () local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 3 ) then -- Cantidad del nivel, el if Verifica que si "nivel" definido anteriormente es de 3 ">" Saldría el mensaje en el chat outputChatBox ( "Tienes 3 Niveles de Busqueda" ) end end Donde pongo esto alvarez? Link to comment
AlvareZ_ Posted June 29, 2013 Share Posted June 29, 2013 Otro ejemplo que lo entiendas mejor ya tu ves local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 1 ) then givePlayerMoney (thePlayer, 3000) elseif ( nivel > 2 ) then givePlayerMoney (thePlayer, 4000) Hay si su nivel es de 1 le dará 3000 si su nivel es de 2 le dará 4000 lee un poco la función https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel Link to comment
BorderLine Posted June 29, 2013 Share Posted June 29, 2013 Otro ejemplo que lo entiendas mejor ya tu ves local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 1 ) then givePlayerMoney (thePlayer, 3000) elseif ( nivel > 2 ) then givePlayerMoney (thePlayer, 4000) Hay si su nivel es de 1 le dará 3000 si su nivel es de 2 le dará 4000 lee un poco la función https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel eso se bugeara. mayor que 1, es 2, 3 4 y asi todos.. si tienes 6 estrellas, te dara dinero por cada una de esas. local cWL = getPlayerWantedLevel(player) if cWL == 1 then .. elseif cWL == 2 then. nose que devuelve el wantedlevel si un string o algo. Dependera del evento que la definmicion de player sea source u otra cosa que tu definas suerte Link to comment
Sensacion Posted June 29, 2013 Share Posted June 29, 2013 Otro ejemplo que lo entiendas mejor ya tu ves local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 1 ) then givePlayerMoney (thePlayer, 3000) elseif ( nivel > 2 ) then givePlayerMoney (thePlayer, 4000) Hay si su nivel es de 1 le dará 3000 si su nivel es de 2 le dará 4000 lee un poco la función https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel eso se bugeara. mayor que 1, es 2, 3 4 y asi todos.. si tienes 6 estrellas, te dara dinero por cada una de esas. local cWL = getPlayerWantedLevel(player) if cWL == 1 then .. elseif cWL == 2 then. nose que devuelve el wantedlevel si un string o algo. Dependera del evento que la definmicion de player sea source u otra cosa que tu definas suerte No, no se bugea, siempre le daría 3000 si tiene más de 1 estrella porque la primera parte se está cumpliendo, y para lo del dinero por estrellas podrías establecer un valor fijo al dinero, por ejemplo 1500 por estrella, obtener el número de estrellas y multiplicarlo por 1500, luego darle el dinero. Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 Otro ejemplo que lo entiendas mejor ya tu ves local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 1 ) then givePlayerMoney (thePlayer, 3000) elseif ( nivel > 2 ) then givePlayerMoney (thePlayer, 4000) Hay si su nivel es de 1 le dará 3000 si su nivel es de 2 le dará 4000 lee un poco la función https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel > 1 ) then givePlayerMoney (attacker, thePlayer, 3000) elseif ( nivel > 2 ) then givePlayerMoney (attacker, thePlayer, 4000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) asi estaria bien como lo puse en el script? Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 Pone if nivel == 1, nivel == 2, no uses > porque eso quiere decir mayor que. Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 Pone if nivel == 1, nivel == 2, no uses > porque eso quiere decir mayor que. createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel == 1 ) then givePlayerMoney (attacker, thePlayer, 3000) elseif ( nivel == 2 ) then givePlayerMoney (attacker, thePlayer, 4000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Asi estaria bien solid? Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 Si, pero solo cuando tengas nivel 2 de busqueda te metera en la carcel, asi lo pusiste vos. Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 Si, pero solo cuando tengas nivel 2 de busqueda te metera en la carcel, asi lo pusiste vos. y para que tenga 1 y los arreste de 1 asta el 6 nivel borro estas dos lineas ? elseif ( nivel == 2 ) then givePlayerMoney (attacker, thePlayer, 4000) Link to comment
Castillo Posted June 29, 2013 Share Posted June 29, 2013 setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) Pone eso despues del 'end' que cierra el 'if' que verifica el nivel de busqueda. Link to comment
~P0W3R~ Posted June 29, 2013 Author Share Posted June 29, 2013 setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) Pone eso despues del 'end' que cierra el 'if' que verifica el nivel de busqueda. if ( nivel == 1 ) then givePlayerMoney (attacker, thePlayer, 3000) elseif ( nivel == 2 ) then givePlayerMoney (attacker, thePlayer, 4000) end setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) hay esta bien solid? Link to comment
~P0W3R~ Posted June 30, 2013 Author Share Posted June 30, 2013 Si.´ createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel == 1 ) then givePlayerMoney (attacker, thePlayer, 3000) elseif ( nivel == 2 ) then givePlayerMoney (attacker, thePlayer, 4000) end setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) solid no me funciono me darias otra forma de que funcione me lo correguis? Link to comment
AlvareZ_ Posted June 30, 2013 Share Posted June 30, 2013 Intenta esto createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) local nivel = getPlayerWantedLevel ( thePlayer ) if ( nivel == 1 ) then givePlayerMoney (attacker, thePlayer, 3000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) elseif ( nivel == 2 ) then givePlayerMoney (attacker, thePlayer, 4000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Link to comment
EstrategiaGTA Posted July 1, 2013 Share Posted July 1, 2013 ¿Porqué no lo pruebas y nos dices? Link to comment
MTA Team 0xCiBeR Posted July 15, 2013 MTA Team Share Posted July 15, 2013 Primero que nada tus argumentos de givePlayerMoney estaban mal, segundo definiste mal getPlayerWantedLevel ya que en ningun lugar defines thePlayer createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 0, 149, 255) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "Policia", true ) outputChatBox("Ahora Fuiste Asignado Policia.",source,0,149,255) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) outputChatBox ( "Fuiste Arrestado Por "..theCop.. " para 100 segundos.", source ) local playeraccount = getPlayerAccount ( attacker ) local nivel = getPlayerWantedLevel ( source ) if ( nivel == 1 ) then givePlayerMoney (attacker, 3000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) elseif ( nivel == 2 ) then givePlayerMoney (attacker, 4000) setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Link to comment
Recommended Posts