depato123 Posted November 10, 2013 Share Posted November 10, 2013 Hola tengo un problema con un pick up policePickUp = createPickUp (1275, 252.00704956055, 111.79605102539, 1003.21875) function policePickUp () if ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) == "Policia" ) then giveplayerweapon setPedSkin ( source, 280 ) giveWeapon ( source, 22, 255, true ) giveWeapon ( source, 3, 1, false ) setPedArmor ( source, 50 ) else outputChatBox ( "solo los policias pueden recojer el armamento", source) end end addEventHandler ( "onPickupUse", policePickUp, policeskinpickup ) [2013-11-10 12:48:29] SCRIPT ERROR: resource\1.lua:6: '=' expected near 'setPedSkin' [2013-11-10 12:48:29] ERROR: Loading script failed: resource\1.lua:6: '=' expected near 'setPedSkin' Ese es el error que me sale. El resource tendria que verificar si el usuario que pasa por el pick up es del team "Policias", si el usuario lo es tendria que darle 2 armas, armadura y un skin, y si el usuario no lo es tendria que aparecerle "solo los policias pueden recojer el armamento". Pero me sale ese error. Ayuda Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 Quita esto: "giveplayerweapon". Link to comment
depato123 Posted November 10, 2013 Author Share Posted November 10, 2013 Quita esto: "giveplayerweapon". fail . Me tira otro error ahora policepickup = createPickup (252.00704956055, 111.79605102539, 1003.21875, 3, 1275, 15000 ) function pickuphit () if ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) == "Policia" ) then setPedSkin ( source, 280 ) giveWeapon ( source, 22, 255, true ) giveWeapon ( source, 3, 1, false ) setPedArmor ( source, 50 ) else outputChatBox ( "solo los policias pueden recojer el armamento", source) end end addEventHandler ( "onPickupUse", pickuphit, policepickup ) [2013-11-10 13:22:05] WARNING: resource\1.lua:13: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 Pusiste alrevez los argumentos en addEventHandler, "policepickup" tiene que ir donde pusiste "pickuphit" y "pickuphit" tiene que ir donde pusiste "policepickup". Link to comment
depato123 Posted November 10, 2013 Author Share Posted November 10, 2013 No se que pasa con los errores... Ahora me sale esto [2013-11-10 13:35:15] WARNING: frecam\1.lua:5: Bad 'player' pointer @ 'getPlayerTeam'(1) policepickup = createPickup (252.00704956055, 111.79605102539, 1003.21875, 3, 1275, 15000 ) setElementInterior ( policepickup, 10 ) function pickuphit () if ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) == "Policia" ) then setPedSkin ( source, 280 ) giveWeapon ( source, 22, 255, true ) giveWeapon ( source, 3, 1, false ) setPedArmor ( source, 50 ) else outputChatBox ( "solo los policias pueden recojer el armamento", source) end end addEventHandler ( "onPickupUse", policepickup, pickuphit ) Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 Eso es porque 'source' es el pickup que usaste. Link to comment
Recommended Posts