Tomas Posted February 20, 2014 Posted February 20, 2014 Hola, tengo un problema con este script... El problema es que no encuentro el error que me sale en el debug. --Team function crearteam () militarteam = createTeam ( "Militares", 0, 100, 0 ) end addEventHandler("onResourceStart", resourceRoot, crearteam) --Team fin --Funcion,comando y local function lol ( player, command ) local account = getPlayerAccount(source) local player = getAccountName ( getPlayerAccount ( player ) ) local zombiekills = getAccountData(account,"Zombie kills") if (zombiekills >= 3500) and (zombiekills <= 10000000) then setPlayerTeam ( player, militarteam ) setElementModel( player, 103) giveWeapon ( player , 3 ) setPlayerNametagColor ( player, 0, 100, 0 ) end end addCommandHandler ( "militar", lol ) --Funcion,comando y local fin Cheque las funciones y todas son Server o Client-Server así que nose que pasa DEBUG: WARNING: XXXX://server1.lua:9: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] WARNING: XXXX://server1.lua:11: Bad argument @'getAccountData' [Expected account at argument 1, got boolean] ERROR: XXXX://server1.lua:12: attempt to compare numer whit boolean Currently developing for International Gaming Community - Join us!
Alexs Posted February 20, 2014 Posted February 20, 2014 --Team function crearteam () militarteam = createTeam ( "Militares", 0, 100, 0 ) end addEventHandler("onResourceStart", resourceRoot, crearteam) --Team fin --Funcion,comando y local function lol ( player, command ) local account = getPlayerAccount(player) local zombiekills = getAccountData(account,"Zombie kills") if (zombiekills >= 3500) and (zombiekills <= 10000000) then setPlayerTeam ( player, militarteam ) setElementModel( player, 103) giveWeapon ( player , 3 ) setPlayerNametagColor ( player, 0, 100, 0 ) end end addCommandHandler ( "militar", lol ) --Funcion,comando y local fin Prueba eso, era un sencillo error con el argumento, tu jugador es 'player', pero en cambio tu utilizaste 'source' lo que provocaba todos esos errores. *También quite una linea que aunque no hacia nada, si provocaría errores. Developer @ MYVAL
Tomas Posted February 20, 2014 Author Posted February 20, 2014 Graciassss, funciona bien, pero ahora no asigna el team D: Yo no veo errores, nose porque ._. PD: En el debug no sale nada. EDIT: Si funciona, tenía otro resource que se entrometió en los teams ^^ Ya funciona, nuevamente gracias :3 Currently developing for International Gaming Community - Join us!
Recommended Posts